wrote some of the code for the input and output operations needed for the EliminateDuplicated function