added code to be able to cache a matrix inverse

Ready to submit to coursera