use Math.max to array