Added clamp function to math