Added user specification of character group length.