solution for inverse matrix cache