finish coding of threads, to test it.