cachematrix.R modified.