generateRandomName() utility function