Completed iterRemove function