got semaphore idea working... need to clean this all up and remove all the test stuff..