new code for bundle_registration from elef/bundle_registration branch