def isValidFlag(flag, usedFlags = ['h', 'g']):
  """
  Takes a string and checks to make sure it is a valid flag.
  A valid flag is one alpha character and is not used already.
  If flag is valid adds it to used flags list.
  By defualt h and g are used flags.
  """
  if flag.isalpha and len(flag) == 1 and flag not in usedFlags:
    usedFlags.append(flag) # Add flag to used flags
    return True
  return False