refactored code based on issue#2
organized into src/graph for graph components