added preferences, working on removing duplicates