fixed sample index thing