added network code, fixed trait association