first working version of louvain method & integration with existing code