create the thread version of the algo