ADDED some classes and methods to deal with networking.