Refactored the cardflip function to move oldState to newState