added training, test, resume training functionality