Bootstrap Functions (originally by Angelo Canty for S)