Sort on index saved in vars