Implemented caching solve functionality