Improved performance of getPlayersScores() function