Update cachematrix.R

This is my Assignment 2 submission.