Redid the border functions for min() and max()