Sorting indexes

Signed-off-by: Renato Stoffalette Joao <renatosjoao@gmail.com>