implemented cachematrix.R