added index code back in