add logic of unit conversion