Pass number of threads to constructor