restored clamp to move entity code