started working on semaphore