cleaned up network set code