refactored randomizeNetwork() and generateRandomNetwork(), still not
tested