added index example and re-arranged