main loop and tts class