added a loop to train_new.erb to simplify data usage