Update cachematrix.R

Updated with R code