Added beginning of semaphores