Added a int to store numbers of threads