updated index code