first version of cache matrix work