madechanges to cachematrix.R