Added code for calculating inverse of matrix

The functionality for cache and calculating inverse of matrix is added