Clamp method is wrong

- the order of the parameters "max" and "min" is inverted (based on how they are used)
- the method is wrong. it doensnt set the right bounds