removed useless lines in the computation of modularity