added build suffix tree function