changed some index code