Added code for Homework 2

Cache the inverse of a matrix to avoid repeatedly having to compute the
inverse