Rhiannon's sorting