Added dupe check and other stuff...