Modifications on ymax in detect_fct