cachematrix implemented