implemented connection rule writer by copying writer from random
distribution module (should really use common code for this)