change to using newStdGen & wrapping in IO