Update cachematrix.R

My tested code