Changed the name of the variable currentPeriod to..

...currentChapter. Simplified some of the code.