don't push nodes into an array before changing them

reminder to self: don't just copy/paste code from the internet