add thread id
create functions add and intersection