fixed race condition, added coloring of nodes and edges