implementation of SVM