first draft of the embedding algorithm.
no complexity analysis, still very messy.
isomorphism not done yet.