Add function medianlinecorrection