Update cachematrix.R

Modified code for PA2