trying to work out pthreads