comments and matrix inverse caching code added