make expand1() use a non-recursive descent function to avoid stack overflows