Updated median filter to compile with new matrix implementation