Imlemented unit conversion in calculations