Methods to find the minimum and maximum