added  the part when they print the sum of max and min