Combined Andy's network code.