add edges more carefully.