fancy for loop threading