refactoring and introducing DualDecomp
adding dual decomposition and refactoring substantially