implementation of cached matrix solution