add test + fix printing count of duplicated lines