WIP commit: implement handling of duplicates