copy v1 to v2.
implement v2 to use Thread.
accept argument to read and write commands.