initial version of modular decomposition