writer offsets calculated, write file