added a command to remove duplicate names when possible.