Implemented basic graph in Python