fixed bug, but now duplicate entries are sometimes made due to recursive movement through graph to create paths