add pseudo random gen in pure code demo