finish quickTrain

close files when we are done and also delete unused variables