Implemented the cache matrix

2 functions impletmented, comments added