randomness improvements to chargenerator.lua