switched from telnetlib to raw sockets. +minor changes.