comments in graph creation algorithm updated