Incorporated the function indices_2d from indices_2d.py