properly handling unit math