Update cachematrix.R

Finalized cachematrix.R