changed name generation to a for loop

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