cachematrix functionality