Added code to cache matrix inverse