Cleaned up movement code.