       if /right|left/.test placement
         topEdgeOffset    = pos.top - viewportPadding - viewportDimensions.scroll
         bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
-        if topEdgeOffset < viewportDimensions.top
+        if topEdgeOffset < viewportDimensions.top #top overflow
           delta.top = viewportDimensions.top - topEdgeOffset
-        else if bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height
+        else if bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height #bottom overflow
           delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
       else
         leftEdgeOffset  = pos.left - viewportPadding
         rightEdgeOffset = pos.left + viewportPadding + actualWidth
-        if leftEdgeOffset < viewportDimensions.left
+        if leftEdgeOffset < viewportDimensions.left #left overflow
           delta.left = viewportDimensions.left - leftEdgeOffset
-        else if rightEdgeOffset > viewportDimensions.width
+        else if rightEdgeOffset > viewportDimensions.width #right overflow
           delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
 
       delta
 
     getTitle: ->
-      $e = @$element
-      o  = @options
-      title = $e.attr('data-original-title') or (if typeof o.title == 'function' then o.title.call($e[0]) else  o.title)
-      title
+      @$element.attr('data-original-title') or (if typeof @options.title == 'function' then @options.title.call(@$element[0]) else  @options.title)
 
     tip: ->
       @$tip = @$tip or $(@options.template)
 
     arrow: ->
-      @$arrow = @$arrow or @tip().find('.tooltip-arrow')
+      @$arrow = @$arrow or @tip().find('.arrow')
 
     validate: ->
       if !@$element[0].parentNode

      marginLeft = parseInt($tip.css('margin-left'), 10)

      # we must check for NaN for ie 8/9
      marginTop  = 0 if isNaN(marginTop)
      marginLeft = 0 if isNaN(marginLeft)

      offset.top  = offset.top  + marginTop
      offset.left = offset.left + marginLeft

      # $.fn.offset doesn't round pixel values
      # so we use setOffset directly with our own function B-0

      @enabled = !@enabled

    toggle: (e) ->
      self = @
      if e
        self = $(e.currentTarget).data('bs.' + @type)
        if !self
