added boostrapping

Adapted code from http://adorio-research.org/wordpress/?p=12295