write sub