Math.max instead of Math.min