Solve method updated