Added basic turn sorting function