modified and deleted the repeated nodes