Write everything in one pass