Update cachematrix.R

Updated the code in the function.