finished code for creating typoedges