graph class from txt file
works for test cases but not assignment