added code to build and test cache matrix