More clearing out and sorting-REVISED