remove duplicates in code