re-tested the code samples in appendix A