controller.c: just updated the median filter