1st version of cache matrix