def newline_join(string, line_length):
    """
    Inserts newline into the string. Newline is inserted at first the word 
    boundary after the line_length characters.

    Parameters
    ----------
    string : str
        String to insert newlines into.
    line_length : int
        Line length threshold after which the new line will be inserted.

    Returns
    -------
    str with inserted newlines

    """
    array = string.split()
    count = 0
    line = ""
    for word in array:
        count = count + len(word) + 1
        if count > line_length:
            line = line + "\n" + word
            count = len(word)
        else:
            line = line + " " + word
            
    return(line.strip())