add 'id' field to Node
correct reverse/clone/topsort functions