refactor error and dungeon_level logicals
add Appendix A