changed ifs to add more chapters