corrected semaphores (added &)