added two subclasses of Thread, which represent server and client