more documentation
implement semaphore myself