Start to convert bootstrap code from R to Julia