Updated cachematrix.R with code