implement network code, doesn't work