my cachematrix function