Use int type for sample index