Changed KS transform from mean to median.