first version of networking code