add key to sort on and use external sorting
add loci per task accumulator