More network code, still not working yet