Final working version of Assignment 2 caching matrix inversion code