Do not process already visited objects
Merge pull request #2 from patrickli/deduplicate

Do not process already visited objects