The number of threads is now a parameter given to the program.