speeding up formatting of edge lists