Programming assignment 2, cached matrix solution.