Create a loop from ID1 counting flat line, if ID0 is above the line is changing.