for assignment 2, implemented the methods to cache the inverse of a matrix.