made math.clamp local as not to confuse it with any global stuff later (potentially)