Calculating Formula and Molecular masses