svm first implementation