Assignment 2: function of caching inversed matrix