fixed indexing in predictEdges