added support for repeating characters