Programming Assignment 2 to invert a matrix with cache