Implement basic index sampling

This implements index sampling but without taking care of population and index deletion