added support for bootstrapping. changes are untested.