optimized the chapter function