Updated cachematrix.R with correct code