add multithread.

and also console interation.