Use write to avoid newline problems