Polydecomposition

old version of poly decomposition algo