affine gap, still has problem with backtrack