as you are using node.args[i] later on, you could use an enumerate there