made a closure matrix with cachable inverse