complete the program cachematrix