Caching the Inverse of a Matrix

completed code for assignment 2