added functionality to compute and cache Inverse of Matrix.