Added code to cache inverse of Matrix