start refactoring and fix bugs for multigraph