def neighbors(currentGen, row, column):
    """
        This function takes a 2D array and the row number and
        the column number of the target cell and returns the
        number of neighbor cells that are 1.
    """

    count = 0

    # Handle boundary case for the row number
    if row - 1 < 0:
        minRow = 0
    else:
        minRow = row - 1

    # Handle boundary case for the column number
    if column - 1 < 0:
        minCol = 0
    else:
        minCol = column - 1

    # Use slicing to get the rows
    for rows in currentGen[minRow:row+2]:
        # Use slicing to get the cells
        for cell in rows[minCol:column+2]:
            # Increase count by 1 if the cell is 1
            # Complete this
            if cell == 1:
                count = count + 1

    # Reduce count by 1 if the target cell is also 1
    # Complete this
    if currentGen[row][column] == 1:
        count = count - 1

    # Return the number of neighbors
    return count