how to find minimum and maximum number in a list