Max and min value from array