Calculating volume of substances