changed sign logic for max and min so could resolve to ZERO