final edit cachematrix.R