Created fncs for caching matrix inverse calcs