cut dup code