Small addition, now handles multi-class as well.