add threads and parallel