inverted index mapper (and some other changes)