cleaned index code