added section 4, 9 and Appendix A.2.