helper functions for bootstrap technique