write keys in hdu 0
add iterations