Record the maximum and minimum point