add bundle adjustment code