def in_bounds(x, y, data):
    """
    Checks if given x,y coordinate is in the grid.
    :param data: Data received
    :param x: x coordinate on graph
    :param y: y coordinate on graph
    :return: True if coordinate is in the bounds
    """
    limit = data['board']['height'] - 1
    if x > limit or x < 0 or y > limit or y < 0:
        return False
    else:
        return True