got rid of all custom sleep nonsense, replaced with threading events