change some iterators in build_edgelist. start using itertools. hope future improvements in performance