def removekeys(toc, chapnum):
    """Return new dictionary with all keys that don't start with chapnum"""
    newtoc = {}
    l = len(chapnum)
    for key, value in toc.items():
        if key[:l] != chapnum:
            newtoc[key] = value
    return newtoc