def is_valid(point, grid):
    """
    Function to check the validity of a point before it is added as a neighbor.
    :param point: point to check validity of
    :param grid: grid that contains the point
    :return: bool value if point is valid
    """

    # Check if the point of the grid is out of range or is a wall.
    if (point[0] > 14) or (point[1] > 14) or (grid[point[0]][point[1]] == 0):
        return False
    else:
        return True