added num_threads variable for clarification