Implemented inverse-caching matrix just as it is done in the example. todo:comments
Comments.