def insert_newline(str_to_break: str, width: int) -> str:
    """
    given a long string,
    insert newline to limit displayed string length
    """
    new_str = ""
    this_line = ""
    for word in str_to_break.split(" "):
        this_line+=word+" "
        if len(this_line)>width:
            this_line+="\n"
            new_str+=this_line
            this_line=""
    new_str+=this_line
    return new_str