solving the team's result tables problem