added dupe key code and tests