update the Louvain method and add tests to it