modified test.c to have 3 threads