Added macro to remove duplicates