adding examples and optimization of funcion "Index"