def check_bounds(position, size):
    """
    Checks whether a coordinate is within the indices of a grid.
    
    Parameters
    ----------
    position: list
        the coordinate to check for within the grid
    size: int
        the size of the grid to compare the coordinate values to
    
    Return
    ----------
    boolean:
        True if the coordinate is within the grid, false if otherwise
    """
    for elem in position:
        if elem < 0 or elem >= size:
            return False
    return True