Added some new functions in nixtrain.py