restructured vmcsolver.cpp, debugged with FSund