added some functions to MedianFilter