Speed up single/multiclass using vectors instead of sets