using max instead of min when linearly scaling