Assignment 2 (cached matrix inversion) solved, final version