assignment2 cached matrix inverse