fix most of the tests
do appendices
fix all unit tests