Added solve method to main7