added error handling for if pwdSample can't find any  pairs; reformatted script
switched to most active branch of gbm