adds threads to the serial program