implementing parser error repair. trying to better modularize code creation