follow code style
remove function removeDuplicates because this would change the behaviour and might compromise the results if some removed commands is required for a follow up command