mods to loc rewriter