fixed to work with louvain dicts