Formatting and modified the move functions