done with minithread.c . need testing