Fixing 'process' to accept a number of threads as parameter