def word_wrap(text_to_wrap, text_width):
    """Chop up and word-wrap a long string of text."""
    this_row = ''
    previous_row = ''
    rows = []
    input_words = text_to_wrap.split(' ')
    for word in input_words:
        this_row += word + ' '
        if len(this_row) > text_width:
            rows.append(previous_row[:-1])
            this_row = ''
            this_row += word + ' '
        else:
            previous_row = this_row
    if not this_row == '':
        rows.append(this_row)
    return rows
