Add 'write' into the dictionary

add ‘write’ into the dictionary and modify the format of do…while