calc_index function

Index values