refator and adds undirected examples