added median and ratio filter