first stab
revert debugging changes
add the sort to the index