Added 'MedianFilter' (moved from testcode to main code')