Implemented min() and max()