Added cache matrix solution