fixed sort for non 0 indexed lists