modify network code
modify network code to nearly work