def fill(data, xsize, ysize, x_start, y_start):
    """
    paint bucket functionality in a matrix

    Args:
        data (numpy 2d matrix): a binary 2d matrix where the color of the
            selected point and points with same color is represented by ones and
            the other colors are represented by zeroes.
        xsize int: width of 2d matrix
        ysize int: height of 2d matrix
        x_start int: x position in the matrix where the bucket clicked. The color of
            this point is represented by one.
        y_start int: y position in the matrix where the bucket clicked.

    Returns:
        list of tuples. Each tuple is a x,y pair representing points where the
            color should be changed.
    """
    stack = [(x_start, y_start)]
    while stack:
        column, row = stack[0]
        stack = stack[1:]
        if data[column, row] == 1:
            data[column, row] = 2
            if column > 0:
                stack.append((column - 1, row))
            if column < xsize - 1:
                stack.append((column + 1, row))
            if row > 0:
                stack.append((column, row - 1))
            if row < ysize - 1:
                stack.append((column, row + 1))
