finished index code