add function - compare with before repeated items