revisions to EP code to work with new centrality and some bug fixed