Added debug regex list ref
Change direction of fold function and set debug regex ref list