optimised code, randomness + number format