first draft to solver