functional code
broken!
todo: finish code to traverse graph in connections.txt