Version with only two threads.