fixed indexing in predictEdges (more)