added destructor to Network class