rails application to calculate molar mass