switched all thread loops to use threading events