First working version of generate_rms_distributions.pl