adding data index function