Adding entry and fixing up the index