               @switch_question( next_index, advancing )
               return
 
-          # Hide the current question, show the next question
+          # We've found the next question, so hide the current question, show
+          # the next one, and update the controls.
           @hide_question current_question
           @show_question next_question
-
-          # Update progress bar
+          @currentQuestionIndex = next_index
           @update_progress_bar(next_index)
-
-
-          @currentQuestionIndex = next_index
           @_display_form_buttons(@currentQuestionIndex)
 
           #Start the Geopoint display if geopoint

            @current_language = @set_current_language()

            @repopulateForm()
            @_display_form_buttons(0)
            @

        change_language: (language) ->
          @currentLanguage = language


        switch_question: ( next_index, advancing ) ->
          #TODO: if in group, test relevance/constraint for all children
          current_question = document.flat_fields[@currentQuestionIndex]
          next_question = document.flat_fields[next_index]

          # Case 1: moving backwards through the form to the first question
          # ---------------------------------------------------------------
          #
          # Show the first question, and hide the 'Previous' button.
          if next_index is 0
            @hide_question current_question
            @show_question next_question
            @currentQuestionIndex = 0
            @update_progress_bar(0)
            @_display_form_buttons(0)
            return

          # Case 2: finished the last question in the form
          # ----------------------------------------------
          #
          # Show the submit button.
          if next_index >= @numberOfQuestions
            return unless @passes_question_constraints()
            @currentQuestionIndex = @numberOfQuestions
            @update_progress_bar(next_index)
            @_display_form_buttons(next_index)
            return

          # Case 3: general case, navigating forwards or backwards
          # ------------------------------------------------------

          # If the current question is a group, we must advance the index to
          # the end of the group to reach the next field.
          if advancing
            # Does the current question pass our constraints?
            return unless @passes_question_constraints()

            if current_question.type is 'group'
              next_index = next_index + current_question.children.length
              next_question = document.flat_fields[next_index]

              # If the last question is part of a group, then just show the submit button.
              if next_index >= @numberOfQuestions
                @update_progress_bar(next_index)
                @_display_form_buttons(next_index)
                return


          # If going backwards, check if the question is in a group. If the
          # next question is in a group, i.e. at the end of the group, then we
          # need to move the index back to the beginning of the group.
          else
            group = @get_group_for_question(next_question)
            if group
              next_index = next_index - group.children.length
              next_question = document.flat_fields[next_index]

          # Now that we've found the next question, we need to determine if
          # it's relevant; it could be irrelevant based on preceding values, or
          # a calculation.
          if (next_question.bind?.calculate?) or not
            XFormConstraintChecker.isRelevant( next_question, @queryStringToJSON( $( ".form" ).serialize()) )

              # If its a calculation, calculate it!
              $("#" + next_question.name).val _performCalcluate(next_question.bind.calculate)  if next_question.bind?.calculate?

              # Switch to the next question!
              if advancing
