basic code for networking