added instance varable and related logic to track and check which player's turn it is