Working for N threads - printint out results with max errors