port back to Threads, allow input form STDIN