cleaning NBtrain.py