Rewrote TUI code, fixed huge bug in stratum thread