Created a successfulMove function that handles all the checks/player switching