new version of the Dupe.cs

cleaned some code