First commit (working posixthreads version)