added directed graphs, did changes to undirected api