nitial cachematrix function