change bestcode into hdu