begginings of NaiveBayes re-implementation with easier data structures