Added command line argument to set number of threads