write length is npairs but not nlength