fixing sort to use long indices
2 files changed