sort the returned values for test purposes; order of terms may not be important