replaced list with set -- saves much memory