Added moves table sort logic