     right   : "right"
 
   # will return an object with the amount of clipped pixels
-  boundaryViolations = (coordinates,width,height)=>
+  getBoundaryViolations = (coordinates,width,height)=>
     violations = {}
     if coordinates.left < 0
       violations.left   = -(coordinates.left)

    # check the default values for overlapping boundaries, then
    # recalculate if there are overlaps

    violations = boundaryViolations getCoordsFromPlacement(d, placement, direction),\
    d.container.width, d.container.height

    if Object.keys(violations).length > 0 # check for possible alternatives

      ]

      for variant in variants
        if Object.keys(getBoundaryViolations(getCoordsFromPlacement(d,variant[0],variant[1]),\
        d.container.width, d.container.height)).length is 0
          [placement,direction] = variant
          break
