Assignment 2 - cached version matrix inversion