first import
refactoring; get info about NN term distribution
minor edits