support any number of graph chars in probability code