Add solve method and test