Check if the high_median value is obtained or not , if yes then do not change it as it will be maximum
if ( high_median == - 1 && acc >= parseInt ( Math . ceil ( ( d + 1 ) / 2.0 ) ) ) high_median = v ; }