Refactored turn functions into one routine