Creating testing data from half of cadency.

Code structure fixes. Cleanups.
Variable naming fixed inside statistic calculating functions.