determining order of turns