added functions for dual decomp in python