Cache matrix inverse

Added code to cache matrix inverse