Fixed random number generation to genratei the correct number of digits