def getChapterAt(cur_cIndex, cur_chapters):
    """
    helper function for getting a chapter object at a desired location within a nested list of chapter dicts
    params:
        cur_cIndex: array of indices into cur_chapters
        cur_chapters: array of chapter dict objects (which individually may or may not have nested chapters
        (i.e. store their own array of chaper dict objects (which are subchapters))
    return: the chapter dict object found at provided cIndex (or None if not found)
    """
    if len(cur_cIndex) == 1:
        # finally returns a chapter dict object (not an array)
        return cur_chapters[cur_cIndex[0]] if (cur_cIndex[0] < len(cur_chapters)) else None
    if "chapters" not in cur_chapters[cur_cIndex[0]] or not isinstance(cur_chapters[cur_cIndex[0]]["chapters"], list):
        return None # unable to descend further as expected
    return getChapterAt(cur_cIndex[1:], cur_chapters[cur_cIndex[0]]["chapters"])