chapter 9, more IO functions