refactored... added simple error handling for movement