1. James Taylor
  2. bx-python

Commits

Brent Pedersen  committed 424fe01

using this small cython directive [1] improves speed by about 5%
and simply avoids a 0 check where we're dividing by RAND_MAX.

also the __import__('random') in intersection_tests.py still found
the intervals.random module so i just remove the additions to sys.path
then import the restore sys.path in intersection_tests.py

[1] http://wiki.cython.org/enhancements/compilerdirectives

  • Participants
  • Parent commits 37f2fb7
  • Branches default

Comments (0)

Files changed (3)

File lib/bx/intervals/intersection.c

View file
  • Ignore whitespace
-/* Generated by Cython 0.11.3 on Mon Mar 15 12:01:53 2010 */
+/* Generated by Cython 0.12.1 on Tue Jul 27 14:02:05 2010 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
 #else
+
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #endif
 #if PY_VERSION_HEX < 0x02040000
   #define METH_COEXIST 0
   #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
+  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   typedef int Py_ssize_t;
   #define PY_SSIZE_T_MAX INT_MAX
   #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
   #define PyNumber_Index(o)    PyNumber_Int(o)
   #define PyIndex_Check(o)     PyNumber_Check(o)
+  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
 #endif
+
 #if PY_VERSION_HEX < 0x02060000
   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
   #define PyType_Modified(t)
 
   typedef struct {
-       void *buf;
-       PyObject *obj;
-       Py_ssize_t len;
-       Py_ssize_t itemsize;
-       int readonly;
-       int ndim;
-       char *format;
-       Py_ssize_t *shape;
-       Py_ssize_t *strides;
-       Py_ssize_t *suboffsets;
-       void *internal;
+     void *buf;
+     PyObject *obj;
+     Py_ssize_t len;
+     Py_ssize_t itemsize;
+     int readonly;
+     int ndim;
+     char *format;
+     Py_ssize_t *shape;
+     Py_ssize_t *strides;
+     Py_ssize_t *suboffsets;
+     void *internal;
   } Py_buffer;
 
   #define PyBUF_SIMPLE 0
   #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
 
 #endif
+
 #if PY_MAJOR_VERSION < 3
   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
 #endif
+
 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
-  #define PyString_Type                PyBytes_Type
-  #define PyString_CheckExact          PyBytes_CheckExact
+  #define PyString_Type                PyUnicode_Type
+  #define PyString_CheckExact          PyUnicode_CheckExact
+#else
+  #define PyBytes_Type                 PyString_Type
+  #define PyBytes_CheckExact           PyString_CheckExact
+#endif
+
+#if PY_MAJOR_VERSION >= 3
   #define PyInt_Type                   PyLong_Type
   #define PyInt_Check(op)              PyLong_Check(op)
   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
 #else
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define PyBytes_Type                 PyString_Type
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+
 #endif
+
 #if PY_MAJOR_VERSION >= 3
   #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
 #endif
+
 #if !defined(WIN32) && !defined(MS_WINDOWS)
   #ifndef __stdcall
     #define __stdcall
 #else
   #define _USE_MATH_DEFINES
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
 #endif
+
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_NAMESTR(n) ((char *)(n))
   #define __Pyx_DOCSTR(n)  ((char *)(n))
 #include <math.h>
 #define __PYX_HAVE_API__bx__intervals__intersection
 #include "stdlib.h"
-#define __PYX_USE_C99_COMPLEX defined(_Complex_I)
-
-
-#ifdef __GNUC__
-#define INLINE __inline__
-#elif _WIN32
-#define INLINE __inline
-#else
-#define INLINE 
+
+#ifndef CYTHON_INLINE
+  #if defined(__GNUC__)
+    #define CYTHON_INLINE __inline__
+  #elif defined(_MSC_VER)
+    #define CYTHON_INLINE __inline
+  #else
+    #define CYTHON_INLINE 
+  #endif
 #endif
 
-typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/
-
-
-
-static int __pyx_skip_dispatch = 0;
+typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
 
 
 /* Type Conversion Predeclarations */
 #define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))
 
 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 
 #if !defined(T_PYSSIZET)
 #if PY_VERSION_HEX < 0x02050000
 #endif
 #endif
 
-static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 
 static const char *__pyx_filename;
 static const char **__pyx_f;
 
-static char __pyx_mdoc[] = "\nData structure for performing intersect queries on a set of intervals which\npreserves all information about the intervals (unlike bitset projection methods).\n\n:Authors: James Taylor (james@jamestaylor.org),\n          Ian Schenk (ian.schenck@gmail.com),\n          Brent Pedersen (bpederse@gmail.com)\n";
-
-
-#ifdef CYTHON_REFNANNY
-typedef struct {
-  void (*INCREF)(void*, PyObject*, int);
-  void (*DECREF)(void*, PyObject*, int);
-  void (*GOTREF)(void*, PyObject*, int);
-  void (*GIVEREF)(void*, PyObject*, int);
-  void* (*NewContext)(const char*, int, const char*);
-  void (*FinishContext)(void**);
-} __Pyx_RefnannyAPIStruct;
-static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
-#define __Pyx_ImportRefcountAPI(name)   (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI")
-#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__)
-#define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r)
-#define __Pyx_SetupRefcountContext(name)   void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__)
-#define __Pyx_FinishRefcountContext()   __Pyx_Refnanny->FinishContext(&__pyx_refchk)
-#else
-#define __Pyx_INCREF(r) Py_INCREF(r)
-#define __Pyx_DECREF(r) Py_DECREF(r)
-#define __Pyx_GOTREF(r)
-#define __Pyx_GIVEREF(r)
-#define __Pyx_XDECREF(r) Py_XDECREF(r)
-#define __Pyx_SetupRefcountContext(name)
-#define __Pyx_FinishRefcountContext()
-#endif /* CYTHON_REFNANNY */
-#define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r)
-#define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r)
-
-static void __Pyx_RaiseDoubleKeywordsError(
-    const char* func_name, PyObject* kw_name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
-
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-
-static INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
-    const char* function_name, int kw_allowed); /*proto*/
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
-
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
-
-static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-
-static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
-
-static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static void __Pyx_WriteUnraisable(const char *name); /*proto*/
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-
-static void __Pyx_AddTraceback(const char *funcname); /*proto*/
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
 
 /* Type declarations */
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":229
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":231
  * 
  * 
  *     cpdef left(self, position, int n=1, int max_dist=2500):             # <<<<<<<<<<<<<<
   int max_dist;
 };
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":244
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":246
  *         return r[:n]
  * 
  *     cpdef right(self, position, int n=1, int max_dist=2500):             # <<<<<<<<<<<<<<
   int max_dist;
 };
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":58
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":60
  * cdef float nlog = -1.0 / log(0.5)
  * 
  * cdef class IntervalNode:             # <<<<<<<<<<<<<<
   struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *croot;
 };
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":306
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":308
  *         return cmp( self.start, other.start ) or cmp( self.end, other.end )
  * 
  * cdef class IntervalTree:             # <<<<<<<<<<<<<<
   struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *root;
 };
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":271
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":273
  * ## ---- Wrappers that retain the old interface -------------------------------
  * 
  * cdef class Interval:             # <<<<<<<<<<<<<<
 };
 
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":58
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":60
  * cdef float nlog = -1.0 / log(0.5)
  * 
  * cdef class IntervalNode:             # <<<<<<<<<<<<<<
   void (*_traverse)(struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *, PyObject *);
 };
 static struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *__pyx_vtabptr_2bx_9intervals_12intersection_IntervalNode;
+
+#ifndef CYTHON_REFNANNY
+  #define CYTHON_REFNANNY 0
+#endif
+
+#if CYTHON_REFNANNY
+  typedef struct {
+    void (*INCREF)(void*, PyObject*, int);
+    void (*DECREF)(void*, PyObject*, int);
+    void (*GOTREF)(void*, PyObject*, int);
+    void (*GIVEREF)(void*, PyObject*, int);
+    void* (*SetupContext)(const char*, int, const char*);
+    void (*FinishContext)(void**);
+  } __Pyx_RefNannyAPIStruct;
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+  static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
+    PyObject *m = NULL, *p = NULL;
+    void *r = NULL;
+    m = PyImport_ImportModule((char *)modname);
+    if (!m) goto end;
+    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+    if (!p) goto end;
+    r = PyLong_AsVoidPtr(p);
+  end:
+    Py_XDECREF(p);
+    Py_XDECREF(m);
+    return (__Pyx_RefNannyAPIStruct *)r;
+  }
+  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
+#else
+  #define __Pyx_RefNannySetupContext(name)
+  #define __Pyx_RefNannyFinishContext()
+  #define __Pyx_INCREF(r) Py_INCREF(r)
+  #define __Pyx_DECREF(r) Py_DECREF(r)
+  #define __Pyx_GOTREF(r)
+  #define __Pyx_GIVEREF(r)
+  #define __Pyx_XDECREF(r) Py_XDECREF(r)
+#endif /* CYTHON_REFNANNY */
+#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
+#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
+
+static void __Pyx_RaiseDoubleKeywordsError(
+    const char* func_name, PyObject* kw_name); /*proto*/
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
+
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+
+static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
+    const char* function_name, int kw_allowed); /*proto*/
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+
+static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+
+static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+
+static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
+
+static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
+
+static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+
+static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+
+static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+
+static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+
+static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+
+static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
+
+static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+
+static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+
+static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
+static void __Pyx_WriteUnraisable(const char *name); /*proto*/
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
+
+static void __Pyx_AddTraceback(const char *funcname); /*proto*/
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
 /* Module declarations from bx.intervals.intersection */
 
 static PyTypeObject *__pyx_ptype_2bx_9intervals_12intersection_IntervalNode = 0;
 static PyTypeObject *__pyx_ptype_2bx_9intervals_12intersection_IntervalTree = 0;
 static float __pyx_v_2bx_9intervals_12intersection_nlog;
 static struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_v_2bx_9intervals_12intersection_EmptyNode = 0;
-static PyObject *__pyx_k_3 = 0;
-static INLINE int __pyx_f_2bx_9intervals_12intersection_imax2(int, int); /*proto*/
-static INLINE int __pyx_f_2bx_9intervals_12intersection_imax3(int, int, int); /*proto*/
-static INLINE int __pyx_f_2bx_9intervals_12intersection_imin3(int, int, int); /*proto*/
-static INLINE int __pyx_f_2bx_9intervals_12intersection_imin2(int, int); /*proto*/
+static CYTHON_INLINE int __pyx_f_2bx_9intervals_12intersection_imax2(int, int); /*proto*/
+static CYTHON_INLINE int __pyx_f_2bx_9intervals_12intersection_imax3(int, int, int); /*proto*/
+static CYTHON_INLINE int __pyx_f_2bx_9intervals_12intersection_imin3(int, int, int); /*proto*/
+static CYTHON_INLINE int __pyx_f_2bx_9intervals_12intersection_imin2(int, int); /*proto*/
 #define __Pyx_MODULE_NAME "bx.intervals.intersection"
 int __pyx_module_is_main_bx__intervals__intersection = 0;
 
 /* Implementation of bx.intervals.intersection */
+static PyObject *__pyx_builtin_cmp;
+static char __pyx_k_1[] = "IntervalNode(%i, %i)";
+static char __pyx_k_3[] = "start must be less than end";
+static char __pyx_k_4[] = "Interval(%d, %d";
+static char __pyx_k_5[] = ", value=";
+static char __pyx_k_6[] = ")";
+static char __pyx_k_7[] = "-";
+static char __pyx_k_8[] = "\nData structure for performing intersect queries on a set of intervals which\npreserves all information about the intervals (unlike bitset projection methods).\n\n:Authors: James Taylor (james@jamestaylor.org),\n          Ian Schenk (ian.schenck@gmail.com),\n          Brent Pedersen (bpederse@gmail.com)\n";
+static char __pyx_k_9[] = "IntervalNode.insert (line 102)";
+static char __pyx_k_10[] = "IntervalNode.intersect (line 168)";
+static char __pyx_k_11[] = "IntervalNode.left (line 231)";
+static char __pyx_k_12[] = "IntervalNode.right (line 246)";
+static char __pyx_k_13[] = "IntervalTree.insert (line 371)";
+static char __pyx_k_14[] = "IntervalTree.find (line 383)";
+static char __pyx_k_15[] = "IntervalTree.before (line 391)";
+static char __pyx_k_16[] = "IntervalTree.after (line 400)";
+static char __pyx_k_17[] = "IntervalTree.insert_interval (line 411)";
+static char __pyx_k_18[] = "IntervalTree.before_interval (line 420)";
+static char __pyx_k_19[] = "IntervalTree.after_interval (line 429)";
+static char __pyx_k_20[] = "IntervalTree.upstream_of_interval (line 438)";
+static char __pyx_k_21[] = "upstream_of_interval";
+static char __pyx_k_22[] = "IntervalTree.downstream_of_interval (line 450)";
+static char __pyx_k_23[] = "downstream_of_interval";
+static char __pyx_k_24[] = "IntervalTree.traverse (line 462)";
+static char __pyx_k__n[] = "n";
+static char __pyx_k__add[] = "add";
+static char __pyx_k__cmp[] = "cmp";
+static char __pyx_k__end[] = "end";
+static char __pyx_k__key[] = "key";
+static char __pyx_k__find[] = "find";
+static char __pyx_k__left[] = "left";
+static char __pyx_k__root[] = "root";
+static char __pyx_k__sort[] = "sort";
+static char __pyx_k__after[] = "after";
+static char __pyx_k__chrom[] = "chrom";
+static char __pyx_k__cleft[] = "cleft";
+static char __pyx_k__croot[] = "croot";
+static char __pyx_k__right[] = "right";
+static char __pyx_k__start[] = "start";
+static char __pyx_k__value[] = "value";
+static char __pyx_k__before[] = "before";
+static char __pyx_k__cright[] = "cright";
+static char __pyx_k__insert[] = "insert";
+static char __pyx_k__maxend[] = "maxend";
+static char __pyx_k__minend[] = "minend";
+static char __pyx_k__strand[] = "strand";
+static char __pyx_k__reverse[] = "reverse";
+static char __pyx_k____main__[] = "__main__";
+static char __pyx_k____test__[] = "__test__";
+static char __pyx_k__interval[] = "interval";
+static char __pyx_k__max_dist[] = "max_dist";
+static char __pyx_k__minstart[] = "minstart";
+static char __pyx_k__operator[] = "operator";
+static char __pyx_k__position[] = "position";
+static char __pyx_k__priority[] = "priority";
+static char __pyx_k__set_ends[] = "set_ends";
+static char __pyx_k__traverse[] = "traverse";
+static char __pyx_k___traverse[] = "_traverse";
+static char __pyx_k__intersect[] = "intersect";
+static char __pyx_k___intersect[] = "_intersect";
+static char __pyx_k___seek_left[] = "_seek_left";
+static char __pyx_k__attrgetter[] = "attrgetter";
+static char __pyx_k__Intersecter[] = "Intersecter";
+static char __pyx_k___seek_right[] = "_seek_right";
+static char __pyx_k__rotate_left[] = "rotate_left";
+static char __pyx_k__IntervalNode[] = "IntervalNode";
+static char __pyx_k__IntervalTree[] = "IntervalTree";
+static char __pyx_k__add_interval[] = "add_interval";
+static char __pyx_k__rotate_right[] = "rotate_right";
+static char __pyx_k__num_intervals[] = "num_intervals";
+static char __pyx_k__after_interval[] = "after_interval";
+static char __pyx_k__before_interval[] = "before_interval";
+static char __pyx_k__insert_interval[] = "insert_interval";
+static PyObject *__pyx_kp_s_1;
+static PyObject *__pyx_kp_u_10;
+static PyObject *__pyx_kp_u_11;
+static PyObject *__pyx_kp_u_12;
+static PyObject *__pyx_kp_u_13;
+static PyObject *__pyx_kp_u_14;
+static PyObject *__pyx_kp_u_15;
+static PyObject *__pyx_kp_u_16;
+static PyObject *__pyx_kp_u_17;
+static PyObject *__pyx_kp_u_18;
+static PyObject *__pyx_kp_u_19;
+static PyObject *__pyx_kp_u_20;
+static PyObject *__pyx_n_s_21;
+static PyObject *__pyx_kp_u_22;
+static PyObject *__pyx_n_s_23;
+static PyObject *__pyx_kp_u_24;
+static PyObject *__pyx_kp_s_3;
+static PyObject *__pyx_kp_s_4;
+static PyObject *__pyx_kp_s_5;
+static PyObject *__pyx_kp_s_6;
+static PyObject *__pyx_kp_s_7;
+static PyObject *__pyx_kp_u_9;
+static PyObject *__pyx_n_s__Intersecter;
+static PyObject *__pyx_n_s__IntervalNode;
+static PyObject *__pyx_n_s__IntervalTree;
+static PyObject *__pyx_n_s____main__;
+static PyObject *__pyx_n_s____test__;
+static PyObject *__pyx_n_s___intersect;
+static PyObject *__pyx_n_s___seek_left;
+static PyObject *__pyx_n_s___seek_right;
+static PyObject *__pyx_n_s___traverse;
+static PyObject *__pyx_n_s__add;
+static PyObject *__pyx_n_s__add_interval;
+static PyObject *__pyx_n_s__after;
+static PyObject *__pyx_n_s__after_interval;
+static PyObject *__pyx_n_s__attrgetter;
+static PyObject *__pyx_n_s__before;
+static PyObject *__pyx_n_s__before_interval;
+static PyObject *__pyx_n_s__chrom;
+static PyObject *__pyx_n_s__cleft;
+static PyObject *__pyx_n_s__cmp;
+static PyObject *__pyx_n_s__cright;
+static PyObject *__pyx_n_s__croot;
+static PyObject *__pyx_n_s__end;
+static PyObject *__pyx_n_s__find;
+static PyObject *__pyx_n_s__insert;
+static PyObject *__pyx_n_s__insert_interval;
+static PyObject *__pyx_n_s__intersect;
+static PyObject *__pyx_n_s__interval;
+static PyObject *__pyx_n_s__key;
+static PyObject *__pyx_n_s__left;
+static PyObject *__pyx_n_s__max_dist;
+static PyObject *__pyx_n_s__maxend;
+static PyObject *__pyx_n_s__minend;
+static PyObject *__pyx_n_s__minstart;
+static PyObject *__pyx_n_s__n;
+static PyObject *__pyx_n_s__num_intervals;
+static PyObject *__pyx_n_s__operator;
+static PyObject *__pyx_n_s__position;
+static PyObject *__pyx_n_s__priority;
+static PyObject *__pyx_n_s__reverse;
+static PyObject *__pyx_n_s__right;
+static PyObject *__pyx_n_s__root;
+static PyObject *__pyx_n_s__rotate_left;
+static PyObject *__pyx_n_s__rotate_right;
+static PyObject *__pyx_n_s__set_ends;
+static PyObject *__pyx_n_s__sort;
+static PyObject *__pyx_n_s__start;
+static PyObject *__pyx_n_s__strand;
+static PyObject *__pyx_n_s__traverse;
+static PyObject *__pyx_n_s__value;
 static PyObject *__pyx_int_0;
 static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_neg_1;
 static PyObject *__pyx_int_2500;
-static PyObject *__pyx_int_neg_1;
-static char __pyx_k___main__[] = "__main__";
-static PyObject *__pyx_kp___main__;
-static char __pyx_k___repr__[] = "__repr__";
-static PyObject *__pyx_kp___repr__;
-static char __pyx_k___cinit__[] = "__cinit__";
-static PyObject *__pyx_kp___cinit__;
-static char __pyx_k_insert[] = "insert";
-static PyObject *__pyx_kp_insert;
-static char __pyx_k_intersect[] = "intersect";
-static PyObject *__pyx_kp_intersect;
-static char __pyx_k_find[] = "find";
-static PyObject *__pyx_kp_find;
-static char __pyx_k_left[] = "left";
-static PyObject *__pyx_kp_left;
-static char __pyx_k_right[] = "right";
-static PyObject *__pyx_kp_right;
-static char __pyx_k_traverse[] = "traverse";
-static PyObject *__pyx_kp_traverse;
-static char __pyx_k___init__[] = "__init__";
-static PyObject *__pyx_kp___init__;
-static char __pyx_k___cmp__[] = "__cmp__";
-static PyObject *__pyx_kp___cmp__;
-static char __pyx_k_add[] = "add";
-static PyObject *__pyx_kp_add;
-static char __pyx_k_before[] = "before";
-static PyObject *__pyx_kp_before;
-static char __pyx_k_after[] = "after";
-static PyObject *__pyx_kp_after;
-static char __pyx_k_insert_interval[] = "insert_interval";
-static PyObject *__pyx_kp_insert_interval;
-static char __pyx_k_add_interval[] = "add_interval";
-static PyObject *__pyx_kp_add_interval;
-static char __pyx_k_before_interval[] = "before_interval";
-static PyObject *__pyx_kp_before_interval;
-static char __pyx_k_after_interval[] = "after_interval";
-static PyObject *__pyx_kp_after_interval;
-static char __pyx_k_1[] = "upstream_of_interval";
-static PyObject *__pyx_kp_1;
-static char __pyx_k_2[] = "downstream_of_interval";
-static PyObject *__pyx_kp_2;
-static char __pyx_k_start[] = "start";
-static PyObject *__pyx_kp_start;
-static char __pyx_k_end[] = "end";
-static PyObject *__pyx_kp_end;
-static char __pyx_k_interval[] = "interval";
-static PyObject *__pyx_kp_interval;
-static char __pyx_k_sort[] = "sort";
-static PyObject *__pyx_kp_sort;
-static char __pyx_k_position[] = "position";
-static PyObject *__pyx_kp_position;
-static char __pyx_k_n[] = "n";
-static PyObject *__pyx_kp_n;
-static char __pyx_k_max_dist[] = "max_dist";
-static PyObject *__pyx_kp_max_dist;
-static char __pyx_k_func[] = "func";
-static PyObject *__pyx_kp_func;
-static char __pyx_k_value[] = "value";
-static PyObject *__pyx_kp_value;
-static char __pyx_k_chrom[] = "chrom";
-static PyObject *__pyx_kp_chrom;
-static char __pyx_k_strand[] = "strand";
-static PyObject *__pyx_kp_strand;
-static char __pyx_k_other[] = "other";
-static PyObject *__pyx_kp_other;
-static char __pyx_k_num_intervals[] = "num_intervals";
-static PyObject *__pyx_kp_num_intervals;
-static char __pyx_k_fn[] = "fn";
-static PyObject *__pyx_kp_fn;
-static char __pyx_k_operator[] = "operator";
-static PyObject *__pyx_kp_operator;
-static char __pyx_k_Intersecter[] = "Intersecter";
-static PyObject *__pyx_kp_Intersecter;
-static char __pyx_k_key[] = "key";
-static PyObject *__pyx_kp_key;
-static char __pyx_k_attrgetter[] = "attrgetter";
-static PyObject *__pyx_kp_attrgetter;
-static char __pyx_k_5[] = "end";
-static PyObject *__pyx_kp_5;
-static char __pyx_k_reverse[] = "reverse";
-static PyObject *__pyx_kp_reverse;
-static char __pyx_k_6[] = "start";
-static PyObject *__pyx_kp_6;
-static char __pyx_k_cmp[] = "cmp";
-static PyObject *__pyx_kp_cmp;
-static PyObject *__pyx_builtin_cmp;
-static PyObject *__pyx_kp_4;
-static char __pyx_k_4[] = "IntervalNode(%i, %i)";
-static PyObject *__pyx_kp_7;
-static char __pyx_k_7[] = "start must be less than end";
-static PyObject *__pyx_kp_8;
-static PyObject *__pyx_kp_9;
-static PyObject *__pyx_kp_10;
-static char __pyx_k_8[] = "Interval(%d, %d";
-static char __pyx_k_9[] = ", value=";
-static char __pyx_k_10[] = ")";
-static PyObject *__pyx_kp_11;
-static char __pyx_k_11[] = "-";
-static PyObject *__pyx_kp_12;
-static char __pyx_k_12[] = "-";
-
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":30
+static PyObject *__pyx_k_2;
+
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":32
  *     int iabs(int)
  * 
  * cdef inline int imax2(int a, int b):             # <<<<<<<<<<<<<<
  *     return a
  */
 
-static INLINE int __pyx_f_2bx_9intervals_12intersection_imax2(int __pyx_v_a, int __pyx_v_b) {
+static CYTHON_INLINE int __pyx_f_2bx_9intervals_12intersection_imax2(int __pyx_v_a, int __pyx_v_b) {
   int __pyx_r;
   int __pyx_t_1;
-  __Pyx_SetupRefcountContext("imax2");
-
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":31
+  __Pyx_RefNannySetupContext("imax2");
+
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":33
  * 
  * cdef inline int imax2(int a, int b):
  *     if b > a: return b             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":32
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":34
  * cdef inline int imax2(int a, int b):
  *     if b > a: return b
  *     return a             # <<<<<<<<<<<<<<
 
   __pyx_r = 0;
   __pyx_L0:;
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":34
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":36
  *     return a
  * 
  * cdef inline int imax3(int a, int b, int c):             # <<<<<<<<<<<<<<
  *         if c > b:
  */
 
-static INLINE int __pyx_f_2bx_9intervals_12intersection_imax3(int __pyx_v_a, int __pyx_v_b, int __pyx_v_c) {
+static CYTHON_INLINE int __pyx_f_2bx_9intervals_12intersection_imax3(int __pyx_v_a, int __pyx_v_b, int __pyx_v_c) {
   int __pyx_r;
   int __pyx_t_1;
-  __Pyx_SetupRefcountContext("imax3");
-
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":35
+  __Pyx_RefNannySetupContext("imax3");
+
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":37
  * 
  * cdef inline int imax3(int a, int b, int c):
  *     if b > a:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (__pyx_v_b > __pyx_v_a);
   if (__pyx_t_1) {
 
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":36
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":38
  * cdef inline int imax3(int a, int b, int c):
  *     if b > a:
  *         if c > b:             # <<<<<<<<<<<<<<
     __pyx_t_1 = (__pyx_v_c > __pyx_v_b);
     if (__pyx_t_1) {
 
-      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":37
+      /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":39
  *     if b > a:
  *         if c > b:
  *             return c             # <<<<<<<<<<<<<<
     }
     __pyx_L4:;
 
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":38
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":40
  *         if c > b:
  *             return c
  *         return b             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":39
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":41
  *             return c
  *         return b
  *     if a > c:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (__pyx_v_a > __pyx_v_c);
   if (__pyx_t_1) {
 
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":40
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":42
  *         return b
  *     if a > c:
  *         return a             # <<<<<<<<<<<<<<
   }
   __pyx_L5:;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":41
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":43
  *     if a > c:
  *         return a
  *     return c             # <<<<<<<<<<<<<<
 
   __pyx_r = 0;
   __pyx_L0:;
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":43
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":45
  *     return c
  * 
  * cdef inline int imin3(int a, int b, int c):             # <<<<<<<<<<<<<<
  *         if c < b:
  */
 
-static INLINE int __pyx_f_2bx_9intervals_12intersection_imin3(int __pyx_v_a, int __pyx_v_b, int __pyx_v_c) {
+static CYTHON_INLINE int __pyx_f_2bx_9intervals_12intersection_imin3(int __pyx_v_a, int __pyx_v_b, int __pyx_v_c) {
   int __pyx_r;
   int __pyx_t_1;
-  __Pyx_SetupRefcountContext("imin3");
-
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":44
+  __Pyx_RefNannySetupContext("imin3");
+
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":46
  * 
  * cdef inline int imin3(int a, int b, int c):
  *     if b < a:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (__pyx_v_b < __pyx_v_a);
   if (__pyx_t_1) {
 
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":45
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":47
  * cdef inline int imin3(int a, int b, int c):
  *     if b < a:
  *         if c < b:             # <<<<<<<<<<<<<<
     __pyx_t_1 = (__pyx_v_c < __pyx_v_b);
     if (__pyx_t_1) {
 
-      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":46
+      /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":48
  *     if b < a:
  *         if c < b:
  *             return c             # <<<<<<<<<<<<<<
     }
     __pyx_L4:;
 
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":47
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":49
  *         if c < b:
  *             return c
  *         return b             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":48
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":50
  *             return c
  *         return b
  *     if a < c:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (__pyx_v_a < __pyx_v_c);
   if (__pyx_t_1) {
 
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":49
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":51
  *         return b
  *     if a < c:
  *         return a             # <<<<<<<<<<<<<<
   }
   __pyx_L5:;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":50
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":52
  *     if a < c:
  *         return a
  *     return c             # <<<<<<<<<<<<<<
 
   __pyx_r = 0;
   __pyx_L0:;
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":52
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":54
  *     return c
  * 
  * cdef inline int imin2(int a, int b):             # <<<<<<<<<<<<<<
  *     return a
  */
 
-static INLINE int __pyx_f_2bx_9intervals_12intersection_imin2(int __pyx_v_a, int __pyx_v_b) {
+static CYTHON_INLINE int __pyx_f_2bx_9intervals_12intersection_imin2(int __pyx_v_a, int __pyx_v_b) {
   int __pyx_r;
   int __pyx_t_1;
-  __Pyx_SetupRefcountContext("imin2");
-
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":53
+  __Pyx_RefNannySetupContext("imin2");
+
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":55
  * 
  * cdef inline int imin2(int a, int b):
  *     if b < a: return b             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":54
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":56
  * cdef inline int imin2(int a, int b):
  *     if b < a: return b
  *     return a             # <<<<<<<<<<<<<<
 
   __pyx_r = 0;
   __pyx_L0:;
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":72
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":74
  * 
  *     property left_node:
  *         def __get__(self):             # <<<<<<<<<<<<<<
 static PyObject *__pyx_pf_2bx_9intervals_12intersection_12IntervalNode_9left_node___get__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_pf_2bx_9intervals_12intersection_12IntervalNode_9left_node___get__(PyObject *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
-  int __pyx_t_1;
-  __Pyx_SetupRefcountContext("__get__");
-
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":73
+  PyObject *__pyx_t_1 = NULL;
+  int __pyx_t_2;
+  __Pyx_RefNannySetupContext("__get__");
+
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":75
  *     property left_node:
  *         def __get__(self):
  *             return self.cleft if self.cleft is not EmptyNode else None             # <<<<<<<<<<<<<<
  *         def __get__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = (((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cleft != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cleft != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
+  if (__pyx_t_2) {
     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cleft));
-    __pyx_1 = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cleft;
+    __pyx_t_1 = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cleft;
   } else {
     __Pyx_INCREF(Py_None);
-    __pyx_1 = Py_None;
+    __pyx_t_1 = Py_None;
   }
-  __pyx_r = __pyx_1;
-  __pyx_1 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":75
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":77
  *             return self.cleft if self.cleft is not EmptyNode else None
  *     property right_node:
  *         def __get__(self):             # <<<<<<<<<<<<<<
 static PyObject *__pyx_pf_2bx_9intervals_12intersection_12IntervalNode_10right_node___get__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_pf_2bx_9intervals_12intersection_12IntervalNode_10right_node___get__(PyObject *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
-  int __pyx_t_1;
-  __Pyx_SetupRefcountContext("__get__");
-
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":76
+  PyObject *__pyx_t_1 = NULL;
+  int __pyx_t_2;
+  __Pyx_RefNannySetupContext("__get__");
+
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":78
  *     property right_node:
  *         def __get__(self):
  *             return self.cright if self.cright is not EmptyNode else None             # <<<<<<<<<<<<<<
  *         def __get__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = (((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cright != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cright != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
+  if (__pyx_t_2) {
     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cright));
-    __pyx_1 = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cright;
+    __pyx_t_1 = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cright;
   } else {
     __Pyx_INCREF(Py_None);
-    __pyx_1 = Py_None;
+    __pyx_t_1 = Py_None;
   }
-  __pyx_r = __pyx_1;
-  __pyx_1 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":78
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":80
  *             return self.cright if self.cright is not EmptyNode else None
  *     property root_node:
  *         def __get__(self):             # <<<<<<<<<<<<<<
 static PyObject *__pyx_pf_2bx_9intervals_12intersection_12IntervalNode_9root_node___get__(PyObject *__pyx_v_self); /*proto*/
 static PyObject *__pyx_pf_2bx_9intervals_12intersection_12IntervalNode_9root_node___get__(PyObject *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
-  int __pyx_t_1;
-  __Pyx_SetupRefcountContext("__get__");
-
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":79
+  PyObject *__pyx_t_1 = NULL;
+  int __pyx_t_2;
+  __Pyx_RefNannySetupContext("__get__");
+
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":81
  *     property root_node:
  *         def __get__(self):
  *             return self.croot if self.croot is not EmptyNode else None             # <<<<<<<<<<<<<<
  *     def __repr__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = (((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->croot != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
-  if (__pyx_t_1) {
+  __pyx_t_2 = (((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->croot != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
+  if (__pyx_t_2) {
     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->croot));
-    __pyx_1 = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->croot;
+    __pyx_t_1 = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->croot;
   } else {
     __Pyx_INCREF(Py_None);
-    __pyx_1 = Py_None;
+    __pyx_t_1 = Py_None;
   }
-  __pyx_r = __pyx_1;
-  __pyx_1 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":81
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":83
  *             return self.croot if self.croot is not EmptyNode else None
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
-  __Pyx_SetupRefcountContext("__repr__");
-
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":82
+  __Pyx_RefNannySetupContext("__repr__");
+
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":84
  * 
  *     def __repr__(self):
  *         return "IntervalNode(%i, %i)" % (self.start, self.end)             # <<<<<<<<<<<<<<
  *     def __cinit__(IntervalNode self, int start, int end, object interval):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_1 = 0;
   __pyx_t_2 = 0;
-  __pyx_t_2 = PyNumber_Remainder(__pyx_kp_4, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
   __pyx_r = NULL;
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":84
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":86
  *         return "IntervalNode(%i, %i)" % (self.start, self.end)
  * 
  *     def __cinit__(IntervalNode self, int start, int end, object interval):             # <<<<<<<<<<<<<<
   int __pyx_v_end;
   PyObject *__pyx_v_interval = 0;
   int __pyx_r;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_start,&__pyx_kp_end,&__pyx_kp_interval,0};
-  __Pyx_SetupRefcountContext("__cinit__");
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__interval,0};
+  __Pyx_RefNannySetupContext("__cinit__");
   if (unlikely(__pyx_kwds)) {
     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
     PyObject* values[3] = {0,0,0};
     }
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  0:
-      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_start);
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
       if (likely(values[0])) kw_args--;
       else goto __pyx_L5_argtuple_error;
       case  1:
-      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_end);
+      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
       if (likely(values[1])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  2:
-      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_interval);
+      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__interval);
       if (likely(values[2])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
-    __pyx_v_start = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_end = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_start = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_end = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_interval = values[2];
   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
     goto __pyx_L5_argtuple_error;
   } else {
-    __pyx_v_start = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_end = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_start = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_end = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_interval = PyTuple_GET_ITEM(__pyx_args, 2);
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalNode.__cinit__");
   return -1;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":89
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":91
  *         # tree size.  Also, python's uniform is perfect since the
  *         # upper limit is not inclusive, which gives us undefined here.
  *         self.priority = ceil(nlog * log(-1.0/(1.0 * rand()/RAND_MAX - 1)))             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->priority = ceil((__pyx_v_2bx_9intervals_12intersection_nlog * log(((-1.0) / (((1.0 * rand()) / RAND_MAX) - 1)))));
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":90
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":92
  *         # upper limit is not inclusive, which gives us undefined here.
  *         self.priority = ceil(nlog * log(-1.0/(1.0 * rand()/RAND_MAX - 1)))
  *         self.start    = start             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->start = __pyx_v_start;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":91
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":93
  *         self.priority = ceil(nlog * log(-1.0/(1.0 * rand()/RAND_MAX - 1)))
  *         self.start    = start
  *         self.end      = end             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->end = __pyx_v_end;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":92
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":94
  *         self.start    = start
  *         self.end      = end
  *         self.interval = interval             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->interval);
   ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->interval = __pyx_v_interval;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":93
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":95
  *         self.end      = end
  *         self.interval = interval
  *         self.maxend   = end             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->maxend = __pyx_v_end;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":94
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":96
  *         self.interval = interval
  *         self.maxend   = end
  *         self.minstart = start             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->minstart = __pyx_v_start;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":95
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":97
  *         self.maxend   = end
  *         self.minstart = start
  *         self.minend   = end             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->minend = __pyx_v_end;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":96
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":98
  *         self.minstart = start
  *         self.minend   = end
  *         self.cleft    = EmptyNode             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cleft));
   ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cleft = __pyx_v_2bx_9intervals_12intersection_EmptyNode;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":97
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":99
  *         self.minend   = end
  *         self.cleft    = EmptyNode
  *         self.cright   = EmptyNode             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cright));
   ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->cright = __pyx_v_2bx_9intervals_12intersection_EmptyNode;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":98
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":100
  *         self.cleft    = EmptyNode
  *         self.cright   = EmptyNode
  *         self.croot    = EmptyNode             # <<<<<<<<<<<<<<
   ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->croot = __pyx_v_2bx_9intervals_12intersection_EmptyNode;
 
   __pyx_r = 0;
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":100
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":102
  *         self.croot    = EmptyNode
  * 
  *     cpdef IntervalNode insert(IntervalNode self, int start, int end, object interval):             # <<<<<<<<<<<<<<
   struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_v_croot = 0;
   int __pyx_v_decision_endpoint;
   struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_r = NULL;
-  PyObject *__pyx_1 = 0;
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
-  __Pyx_SetupRefcountContext("insert");
+  PyObject *__pyx_t_4 = NULL;
+  int __pyx_t_5;
+  __Pyx_RefNannySetupContext("insert");
+  __Pyx_INCREF((PyObject *)__pyx_v_self);
+  __Pyx_INCREF(__pyx_v_interval);
   /* Check if called by wrapper */
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overriden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_kp_insert); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_1);
-    if (!PyCFunction_Check(__pyx_1) || (PyCFunction_GET_FUNCTION(__pyx_1) != (void *)&__pyx_pf_2bx_9intervals_12intersection_12IntervalNode_insert)) {
+    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__insert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_1);
+    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_2bx_9intervals_12intersection_12IntervalNode_insert)) {
       __Pyx_XDECREF(((PyObject *)__pyx_r));
-      __pyx_t_1 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_2 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+      __pyx_t_3 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
       __Pyx_GIVEREF(__pyx_t_2);
+      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_v_interval);
-      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_interval);
+      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_interval);
       __Pyx_GIVEREF(__pyx_v_interval);
-      __pyx_t_1 = 0;
       __pyx_t_2 = 0;
-      __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
-      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-      if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_2bx_9intervals_12intersection_IntervalNode))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_r = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_t_2);
-      __pyx_t_2 = 0;
+      __pyx_t_3 = 0;
+      __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_2bx_9intervals_12intersection_IntervalNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_r = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_t_3);
+      __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       goto __pyx_L0;
     }
-    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":106
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":108
  *         may or may not be this node!)
  *         """
  *         cdef IntervalNode croot = self             # <<<<<<<<<<<<<<
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __pyx_v_croot = __pyx_v_self;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":109
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":111
  *         # If starts are the same, decide which to add interval to based on
  *         # end, thus maintaining sortedness relative to start/end
  *         cdef int decision_endpoint = start             # <<<<<<<<<<<<<<
  */
   __pyx_v_decision_endpoint = __pyx_v_start;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":110
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":112
  *         # end, thus maintaining sortedness relative to start/end
  *         cdef int decision_endpoint = start
  *         if start == self.start:             # <<<<<<<<<<<<<<
  *             decision_endpoint = end
  * 
  */
-  __pyx_t_4 = (__pyx_v_start == __pyx_v_self->start);
-  if (__pyx_t_4) {
-
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":111
+  __pyx_t_5 = (__pyx_v_start == __pyx_v_self->start);
+  if (__pyx_t_5) {
+
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":113
  *         cdef int decision_endpoint = start
  *         if start == self.start:
  *             decision_endpoint = end             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":113
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":115
  *             decision_endpoint = end
  * 
  *         if decision_endpoint > self.start:             # <<<<<<<<<<<<<<
  *             # insert to cright tree
  *             if self.cright is not EmptyNode:
  */
-  __pyx_t_4 = (__pyx_v_decision_endpoint > __pyx_v_self->start);
-  if (__pyx_t_4) {
-
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":115
+  __pyx_t_5 = (__pyx_v_decision_endpoint > __pyx_v_self->start);
+  if (__pyx_t_5) {
+
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":117
  *         if decision_endpoint > self.start:
  *             # insert to cright tree
  *             if self.cright is not EmptyNode:             # <<<<<<<<<<<<<<
  *                 self.cright = self.cright.insert( start, end, interval )
  *             else:
  */
-    __pyx_t_4 = (__pyx_v_self->cright != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
-    if (__pyx_t_4) {
-
-      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":116
+    __pyx_t_5 = (__pyx_v_self->cright != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
+    if (__pyx_t_5) {
+
+      /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":118
  *             # insert to cright tree
  *             if self.cright is not EmptyNode:
  *                 self.cright = self.cright.insert( start, end, interval )             # <<<<<<<<<<<<<<
  *             else:
  *                 self.cright = IntervalNode( start, end, interval )
  */
-      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->cright->__pyx_vtab)->insert(__pyx_v_self->cright, __pyx_v_start, __pyx_v_end, __pyx_v_interval, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
+      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->cright->__pyx_vtab)->insert(__pyx_v_self->cright, __pyx_v_start, __pyx_v_end, __pyx_v_interval, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_1);
       __Pyx_GOTREF(__pyx_v_self->cright);
       __Pyx_DECREF(((PyObject *)__pyx_v_self->cright));
-      __pyx_v_self->cright = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_t_2);
-      __pyx_t_2 = 0;
+      __pyx_v_self->cright = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_t_1);
+      __pyx_t_1 = 0;
       goto __pyx_L5;
     }
     /*else*/ {
 
-      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":118
+      /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":120
  *                 self.cright = self.cright.insert( start, end, interval )
  *             else:
  *                 self.cright = IntervalNode( start, end, interval )             # <<<<<<<<<<<<<<
  *             # rebalance tree
  *             if self.priority < self.cright.priority:
  */
-      __pyx_t_2 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_3 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_1 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
+      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_1);
+      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
       __Pyx_GIVEREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_v_interval);
-      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_interval);
+      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_interval);
       __Pyx_GIVEREF(__pyx_v_interval);
-      __pyx_t_2 = 0;
+      __pyx_t_1 = 0;
       __pyx_t_3 = 0;
-      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_2bx_9intervals_12intersection_IntervalNode)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_2bx_9intervals_12intersection_IntervalNode)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-      if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_2bx_9intervals_12intersection_IntervalNode))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GIVEREF(__pyx_t_3);
       __Pyx_GOTREF(__pyx_v_self->cright);
       __Pyx_DECREF(((PyObject *)__pyx_v_self->cright));
     }
     __pyx_L5:;
 
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":120
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":122
  *                 self.cright = IntervalNode( start, end, interval )
  *             # rebalance tree
  *             if self.priority < self.cright.priority:             # <<<<<<<<<<<<<<
  *                 croot = self.rotate_left()
  *         else:
  */
-    __pyx_t_4 = (__pyx_v_self->priority < __pyx_v_self->cright->priority);
-    if (__pyx_t_4) {
-
-      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":121
+    __pyx_t_5 = (__pyx_v_self->priority < __pyx_v_self->cright->priority);
+    if (__pyx_t_5) {
+
+      /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":123
  *             # rebalance tree
  *             if self.priority < self.cright.priority:
  *                 croot = self.rotate_left()             # <<<<<<<<<<<<<<
  *         else:
  *             # insert to cleft tree
  */
-      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->__pyx_vtab)->rotate_left(__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->__pyx_vtab)->rotate_left(__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(((PyObject *)__pyx_v_croot));
       __pyx_v_croot = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_t_3);
   }
   /*else*/ {
 
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":124
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":126
  *         else:
  *             # insert to cleft tree
  *             if self.cleft is not EmptyNode:             # <<<<<<<<<<<<<<
  *                 self.cleft = self.cleft.insert( start, end, interval)
  *             else:
  */
-    __pyx_t_4 = (__pyx_v_self->cleft != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
-    if (__pyx_t_4) {
-
-      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":125
+    __pyx_t_5 = (__pyx_v_self->cleft != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
+    if (__pyx_t_5) {
+
+      /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":127
  *             # insert to cleft tree
  *             if self.cleft is not EmptyNode:
  *                 self.cleft = self.cleft.insert( start, end, interval)             # <<<<<<<<<<<<<<
  *             else:
  *                 self.cleft = IntervalNode( start, end, interval)
  */
-      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->cleft->__pyx_vtab)->insert(__pyx_v_self->cleft, __pyx_v_start, __pyx_v_end, __pyx_v_interval, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->cleft->__pyx_vtab)->insert(__pyx_v_self->cleft, __pyx_v_start, __pyx_v_end, __pyx_v_interval, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_GIVEREF(__pyx_t_3);
       __Pyx_GOTREF(__pyx_v_self->cleft);
     }
     /*else*/ {
 
-      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":127
+      /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":129
  *                 self.cleft = self.cleft.insert( start, end, interval)
  *             else:
  *                 self.cleft = IntervalNode( start, end, interval)             # <<<<<<<<<<<<<<
  *             # rebalance tree
  *             if self.priority < self.cleft.priority:
  */
-      __pyx_t_3 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(__pyx_v_start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_1 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(__pyx_v_end); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
       __Pyx_GIVEREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
+      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
+      __Pyx_GIVEREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_v_interval);
-      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_interval);
+      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_interval);
       __Pyx_GIVEREF(__pyx_v_interval);
       __pyx_t_3 = 0;
-      __pyx_t_1 = 0;
-      __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_2bx_9intervals_12intersection_IntervalNode)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-      if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_2bx_9intervals_12intersection_IntervalNode))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GIVEREF(__pyx_t_1);
+      __pyx_t_4 = 0;
+      __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_2bx_9intervals_12intersection_IntervalNode)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_GIVEREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_v_self->cleft);
       __Pyx_DECREF(((PyObject *)__pyx_v_self->cleft));
-      __pyx_v_self->cleft = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_t_1);
-      __pyx_t_1 = 0;
+      __pyx_v_self->cleft = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_t_4);
+      __pyx_t_4 = 0;
     }
     __pyx_L7:;
 
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":129
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":131
  *                 self.cleft = IntervalNode( start, end, interval)
  *             # rebalance tree
  *             if self.priority < self.cleft.priority:             # <<<<<<<<<<<<<<
  *                 croot = self.rotate_right()
  * 
  */
-    __pyx_t_4 = (__pyx_v_self->priority < __pyx_v_self->cleft->priority);
-    if (__pyx_t_4) {
-
-      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":130
+    __pyx_t_5 = (__pyx_v_self->priority < __pyx_v_self->cleft->priority);
+    if (__pyx_t_5) {
+
+      /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":132
  *             # rebalance tree
  *             if self.priority < self.cleft.priority:
  *                 croot = self.rotate_right()             # <<<<<<<<<<<<<<
  * 
  *         croot.set_ends()
  */
-      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->__pyx_vtab)->rotate_right(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->__pyx_vtab)->rotate_right(__pyx_v_self)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(((PyObject *)__pyx_v_croot));
-      __pyx_v_croot = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_t_1);
-      __pyx_t_1 = 0;
+      __pyx_v_croot = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_t_4);
+      __pyx_t_4 = 0;
       goto __pyx_L8;
     }
     __pyx_L8:;
   }
   __pyx_L4:;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":132
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":134
  *                 croot = self.rotate_right()
  * 
  *         croot.set_ends()             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_croot->__pyx_vtab)->set_ends(__pyx_v_croot);
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":133
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":135
  * 
  *         croot.set_ends()
  *         self.cleft.croot  = croot             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((PyObject *)__pyx_v_self->cleft->croot));
   __pyx_v_self->cleft->croot = __pyx_v_croot;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":134
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":136
  *         croot.set_ends()
  *         self.cleft.croot  = croot
  *         self.cright.croot = croot             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((PyObject *)__pyx_v_self->cright->croot));
   __pyx_v_self->cright->croot = __pyx_v_croot;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":135
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":137
  *         self.cleft.croot  = croot
  *         self.cright.croot = croot
  *         return croot             # <<<<<<<<<<<<<<
   __pyx_r = ((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)Py_None); __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_1);
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalNode.insert");
   __pyx_r = 0;
   __pyx_L0:;
   __Pyx_XDECREF((PyObject *)__pyx_v_croot);
+  __Pyx_DECREF((PyObject *)__pyx_v_self);
+  __Pyx_DECREF(__pyx_v_interval);
   __Pyx_XGIVEREF((PyObject *)__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":100
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":102
  *         self.croot    = EmptyNode
  * 
  *     cpdef IntervalNode insert(IntervalNode self, int start, int end, object interval):             # <<<<<<<<<<<<<<
   PyObject *__pyx_v_interval = 0;
   PyObject *__pyx_r = NULL;
   PyObject *__pyx_t_1 = NULL;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_start,&__pyx_kp_end,&__pyx_kp_interval,0};
-  __Pyx_SetupRefcountContext("insert");
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__interval,0};
+  __Pyx_RefNannySetupContext("insert");
   if (unlikely(__pyx_kwds)) {
     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
     PyObject* values[3] = {0,0,0};
     }
     switch (PyTuple_GET_SIZE(__pyx_args)) {
       case  0:
-      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_start);
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
       if (likely(values[0])) kw_args--;
       else goto __pyx_L5_argtuple_error;
       case  1:
-      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_end);
+      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end);
       if (likely(values[1])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("insert", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("insert", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
       case  2:
-      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_interval);
+      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__interval);
       if (likely(values[2])) kw_args--;
       else {
-        __Pyx_RaiseArgtupleInvalid("insert", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __Pyx_RaiseArgtupleInvalid("insert", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "insert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "insert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
-    __pyx_v_start = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_end = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_start = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_end = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_interval = values[2];
   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
     goto __pyx_L5_argtuple_error;
   } else {
-    __pyx_v_start = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_end = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_start = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_end = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_interval = PyTuple_GET_ITEM(__pyx_args, 2);
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("insert", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("insert", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalNode.insert");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->__pyx_vtab)->insert(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self), __pyx_v_start, __pyx_v_end, __pyx_v_interval, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->__pyx_vtab)->insert(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self), __pyx_v_start, __pyx_v_end, __pyx_v_interval, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   __pyx_r = NULL;
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":137
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":139
  *         return croot
  * 
  *     cdef IntervalNode rotate_right(IntervalNode self):             # <<<<<<<<<<<<<<
 static  struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_f_2bx_9intervals_12intersection_12IntervalNode_rotate_right(struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_v_self) {
   struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_v_croot = 0;
   struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_r = NULL;
-  __Pyx_SetupRefcountContext("rotate_right");
-
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":138
+  __Pyx_RefNannySetupContext("rotate_right");
+
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":140
  * 
  *     cdef IntervalNode rotate_right(IntervalNode self):
  *         cdef IntervalNode croot = self.cleft             # <<<<<<<<<<<<<<
   __Pyx_INCREF(((PyObject *)__pyx_v_self->cleft));
   __pyx_v_croot = __pyx_v_self->cleft;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":139
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":141
  *     cdef IntervalNode rotate_right(IntervalNode self):
  *         cdef IntervalNode croot = self.cleft
  *         self.cleft  = self.cleft.cright             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((PyObject *)__pyx_v_self->cleft));
   __pyx_v_self->cleft = __pyx_v_self->cleft->cright;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":140
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":142
  *         cdef IntervalNode croot = self.cleft
  *         self.cleft  = self.cleft.cright
  *         croot.cright = self             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((PyObject *)__pyx_v_croot->cright));
   __pyx_v_croot->cright = __pyx_v_self;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":141
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":143
  *         self.cleft  = self.cleft.cright
  *         croot.cright = self
  *         self.set_ends()             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->__pyx_vtab)->set_ends(__pyx_v_self);
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":142
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":144
  *         croot.cright = self
  *         self.set_ends()
  *         return croot             # <<<<<<<<<<<<<<
   __pyx_L0:;
   __Pyx_XDECREF((PyObject *)__pyx_v_croot);
   __Pyx_XGIVEREF((PyObject *)__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":144
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":146
  *         return croot
  * 
  *     cdef IntervalNode rotate_left(IntervalNode self):             # <<<<<<<<<<<<<<
 static  struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_f_2bx_9intervals_12intersection_12IntervalNode_rotate_left(struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_v_self) {
   struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_v_croot = 0;
   struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_r = NULL;
-  __Pyx_SetupRefcountContext("rotate_left");
-
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":145
+  __Pyx_RefNannySetupContext("rotate_left");
+
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":147
  * 
  *     cdef IntervalNode rotate_left(IntervalNode self):
  *         cdef IntervalNode croot = self.cright             # <<<<<<<<<<<<<<
   __Pyx_INCREF(((PyObject *)__pyx_v_self->cright));
   __pyx_v_croot = __pyx_v_self->cright;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":146
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":148
  *     cdef IntervalNode rotate_left(IntervalNode self):
  *         cdef IntervalNode croot = self.cright
  *         self.cright = self.cright.cleft             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((PyObject *)__pyx_v_self->cright));
   __pyx_v_self->cright = __pyx_v_self->cright->cleft;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":147
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":149
  *         cdef IntervalNode croot = self.cright
  *         self.cright = self.cright.cleft
  *         croot.cleft  = self             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((PyObject *)__pyx_v_croot->cleft));
   __pyx_v_croot->cleft = __pyx_v_self;
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":148
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":150
  *         self.cright = self.cright.cleft
  *         croot.cleft  = self
  *         self.set_ends()             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->__pyx_vtab)->set_ends(__pyx_v_self);
 
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":149
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":151
  *         croot.cleft  = self
  *         self.set_ends()
  *         return croot             # <<<<<<<<<<<<<<
   __pyx_L0:;
   __Pyx_XDECREF((PyObject *)__pyx_v_croot);
   __Pyx_XGIVEREF((PyObject *)__pyx_r);
-  __Pyx_FinishRefcountContext();
+  __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":151
+/* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":153
  *         return croot
  * 
  *     cdef inline void set_ends(IntervalNode self):             # <<<<<<<<<<<<<<
  *             self.maxend = imax3(self.end, self.cright.maxend, self.cleft.maxend)
  */
 
-static INLINE void __pyx_f_2bx_9intervals_12intersection_12IntervalNode_set_ends(struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_v_self) {
+static CYTHON_INLINE void __pyx_f_2bx_9intervals_12intersection_12IntervalNode_set_ends(struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_v_self) {
   int __pyx_t_1;
   int __pyx_t_2;
   int __pyx_t_3;
-  __Pyx_SetupRefcountContext("set_ends");
-
-  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":152
+  __Pyx_RefNannySetupContext("set_ends");
+  __Pyx_INCREF((PyObject *)__pyx_v_self);
+
+  /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":154
  * 
  *     cdef inline void set_ends(IntervalNode self):
  *         if self.cright is not EmptyNode and self.cleft is not EmptyNode:             # <<<<<<<<<<<<<<
   }
   if (__pyx_t_3) {
 
-    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":153
+    /* "/opt/src/bx-python/lib/bx/intervals/intersection.pyx":155
  *     cdef inline void set_ends(IntervalNode self):
  *         if self.cright is not EmptyNode and self.cleft is not EmptyNode:
  *             self.maxend = imax3(self.end, self.cright.maxend, self.cleft.maxend)             # <<<<<<<<<<<<<<
  */