added index functionality