add inverted index from rosettacode