checked for duplicates, updated addition/removal from array