working with 3 threads