add sort into expr

change svm code to allow optimization