Clamp to min/max, added some comments