training and testing scripts