converting to back and forth edges