new logic for sorting last game