Fixed bug where edges were being followed backwards