Update cachematrix.R

Expanded version