Assignment #2 - Caching function for the inverse matrix