def possible_moves(node, game_map):
    """
    Finds the possible neighbors of a node given the map
    """
    y, x = node
    neighs = []

    for i in [(y+1, x), (y-1, x), (y, x+1), (y, x-1)]:  # Creates the list of tuples of possible neighbors
        if 0 <= i[0] < len(game_map) and 0 <= i[1] < len(game_map[0]):  # If it's inside the map, keep it
            neighs.append(i)  # add it to neighbors
    neighs = list(filter(lambda x: game_map[x[0]][x[1]] > -99, neighs))  # filter out walls
    return list(neighs)