Works for 5 threads