network code working mostly