minor renaming, added semaphore