Generalize randinit to work without explicit X

fixes issue #3