removed dead code
better output for duplicates