     tmp = tmp.previousSibling
   pos
 
-fromNode = (el, relativeRoot) ->
+fromNode = ($el, relativeRoot) ->
   try
-    result = simpleXPathJQuery.call el, relativeRoot
+    result = simpleXPathJQuery $el, relativeRoot
   catch exception
     console.log("jQuery-based XPath construction failed! Falling back to
                  manual.")
-    result = simpleXPathPure.call el, relativeRoot
+    result = simpleXPathPure $el, relativeRoot
   result
 
 # Public: Finds an Element Node using an XPath relative to the document root.

# relativeRoot - The root node for the xpath
#
# Returns a string
simpleXPathPure = (relativeRoot) ->

  getPathSegment = (node) ->
    name = getNodeName node

    xpath = xpath.replace /\/$/, ''
    xpath

  jq = $el.map ->
    path = getPathTo this

    path
