This is first version of workable Inverse matrix calc and caching