added Semaphore class