still trying to figure out the semaphore implmentation that doesnt break everything