Implemented cache matrix