rearrange
add thread constructor
comment out threadconstructor
insert thread into foreach loop