Fixed dependency bugs by coalescing declarations, looks like semaphores work, but not prime printing