added implementation of special matrix AND function that computes/caches its inverse