Function flip and validate turn

Function flip and validate turn