Some more work into sorting