Added affine gap functionality, works probably
back trace complete