Changing from array to vector of threads