Updated cachematrix.R for Assignment 2