Electronic and magnetic properties of Mn 12 molecular magnets on sulfonate and carboxylic acid prefunctionalized gold surfaces