finished 1st part of SVM