Graph based

(Sorry for the bad names, I'm a in a hurry tonight. We can fix it tomorrow, but I wanted to get the idea across.)