Slope detection logic. (I put a bunch of clamps in there prior to maybe help with the issue, it didn’t do anything. but perhaps where the problem lies):