Working adding to index. Optimization is needed.