second-pass sorting working.