no longer segfaulting.  Working randomiser