Modified code in cachematrix.R for Programming Assignment 2