added TODO
implement adaptive median_of_3