begin write reply code