Finished Exercise 3 in "I/O" Chapter [p. 650(672)]