Update cachematrix.R

Update for assignment 2.