Index function construction