Cache Inverse Matrix - Revised

Revised code for Assignment 2