finished prototype of Graph class. untested.