better example, fixed bug with duplicate nodes