adjusted array val to create semaphores