[Suffix tree] Started rewriting