sanitizing the input, when you are doing "as num", is pointless as it will return a number. Clamp the value if you don't want it to be too large.