Added a test and changed list() to list(set())