Updated index code