working homegrown multiclass svm