Sensor Median computation

More stable median computation. Also removed an unnecessary check for the change event.