Final cachematrix.R