ctd implementing KS-test.