new function find_gap_valey2
correcting