Improved solve