edit code to cachematrix.R