Added back duplicate function

Reason is that i also need this one. Already have a lot of coding using
in this format