Remove swap and add persistent undo