Improved getRemainingGames function (untested)