Why the Math.min here?