Update cachematrix.R

Commit 3 of programming assignment 2.