refactoring
inverted index search etc
outputs