Code for Inverse Matrix Caching