added the ability to save training data