renamed index to sample