Added solve method