Added Scanner class

pluse some minor changes to Tcp class