Updated cachematrix.R for assignment