Added max and  min computations and corrected bug if US units.