added inverse index for cost per functions