implement cachematrix.R