figuring out sort index mess