Update cachematrix.R

Tested and running.