add modules and remove duplicates