Changed a lot of names, added some comments
Comments and consts for different types of duplicates