Cleaned up movement code