Actually that return 0 unless defined bit was a ghastly way of checking whether there was even something to sort. Thanks for your interpretation and improvement of my lines. :-) (And thank you for the illustration of this other way of using sort that I didn't know/think about before. I've needed this for a while....)