inverse matrix caching assignment, working code.