rewriter now functioning correctly for both edit paths