added cache matrix assignment