Improved dupe test
Removed commented out useless code
Removed all node* stuff and replaced with node IDs