Fixed out-of-turn move issue
Added comments, cleaned some code