Update cachematrix.R

update with R funcyion