Math.min instead of min