some progress
link against pthreads
reorganization