Copied up to p. 131 in Ch. 7 into .js file