weighted returns a closure for generating (random) indices