add generic script for training and testing