Added cardinal sorting - untested!