Custom sorting for word list.