Create maxmin in array