Removed buggy duplicate removal code