def d2_coords(i, j, width=1):
    """
    given the (i,j) get the  coords of the neighbouring cells within `width`
    """
    d2 = [(x, y) for x in range(i - width, i + width + 1) for y in range(j - width, j + width + 1)]

    return d2