Assignment 2 matrix inverse with cache