added credit for mpeterv
Replaced list comp with set comp instead
Fixed comment typo