Solve assignment 2: caching inverted matrices.