code reorganization; implementation of suffix tree