use iter instead of list