This should be Math.min(). No?