Added boolean insertion for add and added compare==0 to prevent duplicates.