Modified the cachematrix.R function.