   # Make sure we're listening to scroll event only if there is 
   # at least one registered dock. 
   register : (key, info_callback) -> 
-    docker.registry[key] = info_callback
-    docker.component_history[key] = {previous: {}, on_dock: {}}
-
-    if !docker.listening_to_scroll_events
+    dockingStation.registry[key] = info_callback
+    dockingStation.component_history[key] = {previous: {}, on_dock: {}}
+
+    if !dockingStation.listening_to_scroll_events
       
-      $(window).on "scroll.docker", -> docker.user_scrolled = true
-      $(window).on "resize.docker", docker.onResize
+      $(window).on "scroll.dockingStation", -> dockingStation.user_scrolled = true
+      $(window).on "resize.dockingStation", dockingStation.onResize
 
       # If the height of a docked component changes, we need to recalculate
       # the layout. Unfortunately, it is non-trivial and error prone to detect 
       # when the height of an element changes, so we'll just check periodically. 
-      docker.check_resize_interval = setInterval docker.onCheckStickyResize, 500
-
-      docker.listening_to_scroll_events = true
+      dockingStation.check_resize_interval = setInterval dockingStation.onCheckStickyResize, 500
+
+      dockingStation.listening_to_scroll_events = true
 
       # Recompute layout if we've seen a scroll in past X ms
-      docker.interval = setInterval -> 
-        if docker.user_scrolled
-          docker.user_scrolled = false
-          docker.onScroll()
+      dockingStation.interval = setInterval -> 
+        if dockingStation.user_scrolled
+          dockingStation.user_scrolled = false
+          dockingStation.onScroll()
       , 100 
 
   unregister : (key) -> 
-    delete docker.registry[key]
-    if _.keys(docker.registry).length == 0
-      $(window).off ".docker"
-      docker.listening_to_scroll_events = false
-      clearInterval docker.check_resize_interval
-      docker.check_resize_interval = null
-      clearInterval docker.interval
-      docker.interval = null
+    delete dockingStation.registry[key]
+    if _.keys(dockingStation.registry).length == 0
+      $(window).off ".dockingStation"
+      dockingStation.listening_to_scroll_events = false
+      clearInterval dockingStation.check_resize_interval
+      dockingStation.check_resize_interval = null
+      clearInterval dockingStation.interval
+      dockingStation.interval = null
 
   #######
   # onScroll
   onScroll : -> 
-    docker.updateViewport()
+    dockingStation.updateViewport()
 
     # At most we will shift the docked components by the distance scrolled
-    max_change = if docker.viewport.last.top?
-                   Math.abs(docker.viewport.top - docker.viewport.last.top)
+    max_change = if dockingStation.viewport.last.top?
+                   Math.abs(dockingStation.viewport.top - dockingStation.viewport.last.top)
                  else
                    Infinity
 
-    docker.layout max_change
+    dockingStation.layout max_change
 
   #######
   # onResize
   onResize : -> 
-    docker.updateViewport()
+    dockingStation.updateViewport()
 
     # Shift the docked components by at most the change in window height
-    max_change = Math.abs(docker.viewport.height - docker.viewport.last.height)
-    docker.layout max_change
+    max_change = Math.abs(dockingStation.viewport.height - dockingStation.viewport.last.height)
+    dockingStation.layout max_change
 
   #######
   # onCheckStickyResize
   onCheckStickyResize : -> 
-    height_changes = 0
-
-    for own k,v of docker.registry
+    
+
+    for own k,v of dockingStation.registry
       dock = fetch k
-      if dock.docked && v().height != docker.component_history[k].previous.height
-        console.error "HEIGHT RESIZE at most #{height_changes}" if debug
-        docker.layout Infinity
+
+      if dock.docked && v().height != dockingStation.component_history[k].previous.height
+        height_change = v().height - dockingStation.component_history[k].previous.height
+
+        console.log "HEIGHT RESIZE at most #{height_change}" if debug
+        dockingStation.layout Math.abs(height_change)
         break
 
 
   #######
   # updateViewport()
   updateViewport : -> 
-    docker.viewport =  
+    dockingStation.viewport =  
       last: 
-        top: docker.viewport.top
-        height: docker.viewport.height
+        top: dockingStation.viewport.top
+        height: dockingStation.viewport.height
       top: document.documentElement.scrollTop || document.body.scrollTop
       height: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)
 


      # TOP OF COMPONENT VISIBLE
      # Try to keep it at or below the viewport, especially when scrolling up
      console.log "\tTOP OF COMPONENT VISIBLE: #{k} >= #{docker.viewport.top} + #{v.jut_above} + #{y_stack}, #{if docker.scrolling_down then 'weak' else 'medium'}" if debug
      solver.addConstraint new c.Inequality \
        y_pos[k], \
        c.GEQ, \
        docker.viewport.top + v.jut_above + y_stack, \
        if docker.scrolling_down then c.Strength.weak else c.Strength.medium
      y_stack += v.height

      # BOTTOM OF COMPONENT VISIBLE
      # Try to keep the bottom above the viewport, especially when scrolling down
      console.log "\tBOTTOM OF COMPONENT VISIBLE: #{k} + #{v.height} <= #{docker.viewport.top} + #{docker.viewport.height}, #{if docker.scrolling_down then 'medium' else 'weak'}" if debug
      solver.addConstraint new c.Inequality \
        y_pos[k], \
        c.LEQ, \
        docker.viewport.top + docker.viewport.height - v.height, \
        if docker.scrolling_down then c.Strength.medium else c.Strength.weak

      # RELATIONAL
      for sv, j in sorted

    solver = new c.SimplexSolver()    

    # We modify the contraints slightly based on whether we're scrolling up or down
    scroll_distance = Math.abs(dockingStation.viewport.top - dockingStation.viewport.last.top)
    if scroll_distance > 0
      dockingStation.scrolling_down = dockingStation.viewport.top > dockingStation.viewport.last.top


    console.log("viewport height: ", dockingStation.viewport.height) if debug
    # We'll iterate through each component in order of their stacking priority
    y_stack = 0

