Made randomness 'pseudo-random', added seed parameter in mode