working, but still shitty graph class