Determination of molarity and molality