First version of cache matrix