Finished the cachematrix file following Roger Peng's style