cachematrix.R by AL