add txt algorithm