added helper function for generating derivatives; fixed page number identifier for books