It would be a great option if the amount of samples taken in the median filter can be more than 3. I would say give begin(number of samples) a parameter that initiates the array for data. This would make it a lot more usefull.