WIP get_next_index

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>