it seems pe is a sentinel value, pointing at char past the last char in input