Implemented logic to switch play between player X and O