           'Output',
           'Example',
           'Constraints']
-    
+    curLang = '';
     render = ->
       probSegs = '<ul>'
       
       for segment in segments
         probSegs += '<li><label>' + segment + '</label> <textarea id="' + segment + '-text"></textarea></li>'
       probSegs += '</ul><button id="goToLangSelect" >Next</button>'
+      probSegs += '<button id="closeIt" style:"inline-block">Close</button>'
       $('#statement-inputs',popup).html probSegs
       checkboxes = '<ul>'
       

          insrtHTML += '<option id="'+language.name+'-option" value="'+language.name+'-txt">'+language.name+'</option>'
      $('#lang-select').html insrtHTML
      hideShow 'language-options','initial-text'
    switchTextBox = ->
      newLang = $('#lang-select',popup).val()
      hideShow curLang,newLang
      curLang = newLang

    $('#goToLangSelect',popup).click langSelect
        
    $('#isCodeSnippet',popup).click ()->
      if($('#isCodeSnippet',popup)[0].checked)
        hideShow 'Submit-button','Next-button'
      else
        hideShow 'Next-button','Submit-button'
    
    $('#backToStatInpt',popup).click hideShow 'language-options','statement-inputs'
    
    $('#Next-button',popup).click initTextSec

    $('#Submit-button,#finalSubmit',popup).click parse

    $('#backToLangSelect',popup).click hideShow 'initial-text','language-options'

    $('#lang-select',popup).change switchTextBox

    parseInput = (s)->
      isMathBlock = false;

      $("##{hideId}",popup).hide()
      $("##{showId}",popup).show()

    $('#closeIt',popup).click ()->
      popup.hide()
      $('statement-inputs',popup).show()
      $('language-options',popup).hide()
      $('initial-text',popup).hide()

    $('#goToLangSelect',popup).click ()->
      hideShow 'statement-inputs','language-options'
        
    $('#isCodeSnippet',popup).click ()->
      if($('#isCodeSnippet',popup)[0].checked)
        hideShow 'Submit-button','Next-button'
      else
        hideShow 'Next-button','Submit-button'
    
    $('#backToStatInpt',popup).click ()->
      hideShow 'language-options','statement-inputs'
    
    $('#Next-button',popup).click ()->
      isFirst = true
      insrtHTML = ''
      for language in languages
        $("##{language.name}-txt",popup).hide()
        if ($('#'+language.name+'-select',popup)[0].checked)
          if isFirst
            $("##{language.name}-txt",popup).show()
            isFirst = false
