Appendix A: Code Listing
Download the source
here
.