finish writing networkgenerator.java