Optimized Movement limiting

Optimized the limiting of movement to just two lines of code. Very
efficient.