added semaphore class