Fix function to return chapter length; rename function