Added median filter.