updating modularity clustering algorithm