Finished cachematrix.R code