add long timeout mode, with lots of gotos and magic constants