Added check for duplicates, removed duplicates.

Fuck yeah.