maj indentation txt algorithm