Using tree set instead of list while adding new triples to efficiently prevent redundant additions.