I really hate Math.min/max