Implemented maximum and minimum.