Remove Duplicates and Remove last Nth