Adding the part for removing duplication of keys