Refactoring sql setup
Removing commented-out code
Dump into SQL even when solve() is called on ok=false  status
Only init the SQL if this is the first time solve() call