Changed index2word computation to use set instead of mapping + int (redundant)