updated the generation part
added community detection and role processing
added a few comments