several changes. added relatedTerms support