First working version of the KS-statistic calculator.