use "nodeIndex" or simply "i" instead of "node"