add chapter and the end pages