   string.replace /^\s*|\s*$/g, ''
 
 addLineBreaks = (str) ->
-  wordCount = 5
+  wordCount = 4
   newString = ''
   str.split(' ').forEach (word, i) ->
     i++

          else
            axios(getRequestConfig('caption', {e: episode, t: timestamp}))
              .then (response) ->
                msg.send getImageUrl(episode, timestamp, response.data.Subtitles[0].Content)

        else
          console.log("D'oh! I couldn't find anything for `#{query[0]}`.");

getImageUrl = (episode, timestamp, caption) ->
  encodedUrl = encode(addLineBreaks(trimWhitespace(caption)))
  "https://frinkiac.com/meme/#{episode}/#{timestamp}.jpg?lines=#{encodedUrl}"

combineCaptions = (captions) ->
  if captions.length <= 3
    newCaption = ''
    captions.forEach (caption, i) ->
      newCaption += caption.Content
      unless i == (captions.length - 1)
        newCaption += '\n'
    newCaption
  else
    captions[0].Content

module.exports = (robot) ->
  robot.respond /(simpsons search|frinkiac) (.*)/i, (msg) ->
