more organization and improvement on randomize-traincurve.pl