did some work on maximum and minimum values