def dale_chall(df):
    """
    Calculates the Dale-Chall formula for each text.
    The formula and its interpretation is given in this wiki page: https://en.wikipedia.org/wiki/Dale%E2%80%93Chall_readability_formula
    
    Needed features:
    Avg_words_per_sentence
    Difficult_word_percent
    
    Adds column:
    Dale_Chall - Dale-Chall formula score for the text 
    """

    # Dale-Chall formula
    df["Dale_Chall"] = 0.1579 * (df["Difficult_word_percent"] * 100) + 0.0496 * df["Avg_words_per_sentence"]
    
    # adjust if percentage of difficul words is greater than 5%
    df.loc[df["Difficult_word_percent"] > 0.05, "Dale_Chall"] += 3.6365
        
    return df