Updating cachematrix.R for Assignment 2