solved affine gap