fixing the bug in scip, everything checks out OK now in the optimization
cleaning up the code