Median filter using array instead of list (**** list caml ****)