cleaning up network code and adding testing
more fixin’