added unique() and changed replace() return value when item not found