Added more code to ch. 3