organizing the index code