fixed populateEdge method.
was previously generating invalid values