allow array nodes to remove other nodes
clean up code, rename variables