in function median filter now copying instead of referencing y_new to y