def extract_shakespeare_data(path = "data/t8.shakespeare.txt"):
    """
    Load the MIT online Shakespeare corpus from a text file.
    
    Args:
        path (str): path to Shakespare text file

    Returns:
        cleaned_text (str): entire cleaned text stripped of header/notes
    """

    with open(path) as f:
        text = f.read()

    cleaned_text = ""
    skip = False
    
    for line in text.split("\n")[244:-1]:
        if line[:2] == "<<":
            skip = True
        elif line[-2:] == ">>":
            skip = False
            continue
        if skip or line == "":
            continue
        line = line+"\n"

        cleaned_text += line

    return cleaned_text