fixed issue with semaphore on more than 2 cores
finished week 4