svm working-ish
optimizations