internal logic for graph creation.