def getOrderedTeamGames(teamGames):
    """
    input: team games
    output: map team -> ordered list of games (by time)
    """
    orderedTeamGames = {}
    for team in teamGames:
        orderedTeamGames[team] = []
        currentTeamGames = teamGames[team]
        keylist = list(currentTeamGames)
        keylist.sort()
        for key in keylist:
            orderedTeamGames[team].append(currentTeamGames[key])
    return orderedTeamGames