No need to use my method directly. I provided it as an example to help you understand how the inverse calculation works. As I said, my method had to be ported between c++ and Fortran, so I made it as simple as possible just using for loops with a one dimensional array. The strategy would be the same for two dimensions, and it would likely be easier and cleaner to follow.