refactoring
fix
naive implementation of dd-trw (komodakis)