change name generation to for loop

Change the repetition of adding a random character six times to a for loop.