Sort the KP result.