Commits

Kanwei Li committed 3b9d30e

Return empty list for interval operations on empty trees to prevent segfaults. Fixes #8

Comments (0)

Files changed (3)

lib/bx/intervals/intersection.c

-/* Generated by Cython 0.11.1 on Tue Apr 28 12:23:04 2009 */
+/* Generated by Cython 0.11.3 on Wed Nov 18 13:14:56 2009 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #include "structmember.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#endif
+#else
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #endif
   #ifndef __cdecl
     #define __cdecl
   #endif
+  #ifndef __fastcall
+    #define __fastcall
+  #endif
 #else
   #define _USE_MATH_DEFINES
 #endif
 #include <math.h>
 #define __PYX_HAVE_API__bx__intervals__intersection
 #include "stdlib.h"
+#define __PYX_USE_C99_COMPLEX defined(_Complex_I)
 
 
 #ifdef __GNUC__
 #define __Pyx_PyBytes_AsString            PyBytes_AsString
 #endif
 
+#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
+#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);
 #endif
 #endif
 
+
+#if !defined(T_ULONGLONG)
+#define __Pyx_T_UNSIGNED_INT(x) \
+        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
+        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
+        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
+#else
+#define __Pyx_T_UNSIGNED_INT(x) \
+        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
+        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
+        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
+        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
+#endif
+#if !defined(T_LONGLONG)
+#define __Pyx_T_SIGNED_INT(x) \
+        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
+        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+        ((sizeof(x) == sizeof(int))   ? T_INT : \
+        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
+#else
+#define __Pyx_T_SIGNED_INT(x) \
+        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
+        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+        ((sizeof(x) == sizeof(int))   ? T_INT : \
+        ((sizeof(x) == sizeof(long))  ? T_LONG : \
+        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
+#endif
+
+#define __Pyx_T_FLOATING(x) \
+        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
+        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))
+
 #if !defined(T_SIZET)
 #if !defined(T_ULONGLONG)
 #define T_SIZET \
 static PyObject *__pyx_m;
 static PyObject *__pyx_b;
 static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
 static int __pyx_lineno;
 static int __pyx_clineno = 0;
 static const char * __pyx_cfilenm= __FILE__;
 
 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);
 
 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
-static INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/
-
 static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
 
 static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
 
 typedef char *__pyx_t_2bx_9intervals_12intersection_char_star;
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":231
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":231
  * 
  * 
  *     cpdef left(self, position, int n=1, int max_dist=2500):             # <<<<<<<<<<<<<<
   int max_dist;
 };
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":246
+/* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":60
+/* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":308
+/* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":273
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":273
  * ## ---- Wrappers that retain the old interface -------------------------------
  * 
  * cdef class Interval:             # <<<<<<<<<<<<<<
 };
 
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":60
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":60
  * cdef float nlog = -1.0 / log(0.5)
  * 
  * cdef class IntervalNode:             # <<<<<<<<<<<<<<
 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*/
-
-const char *__pyx_modulename = "bx.intervals.intersection";
+#define __Pyx_MODULE_NAME "bx.intervals.intersection"
+int __pyx_module_is_main_bx__intervals__intersection = 0;
 
 /* Implementation of bx.intervals.intersection */
 static PyObject *__pyx_int_0;
 static PyObject *__pyx_int_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_12;
 static char __pyx_k_12[] = "-";
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":32
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":32
  * ctypedef char * char_star
  * 
  * cdef inline int imax2(int a, int b):             # <<<<<<<<<<<<<<
   int __pyx_t_1;
   __Pyx_SetupRefcountContext("imax2");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":33
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":33
  * 
  * cdef inline int imax2(int a, int b):
  *     if b > a: return b             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":34
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":34
  * cdef inline int imax2(int a, int b):
  *     if b > a: return b
  *     return a             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":36
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":36
  *     return a
  * 
  * cdef inline int imax3(int a, int b, int c):             # <<<<<<<<<<<<<<
   int __pyx_t_1;
   __Pyx_SetupRefcountContext("imax3");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":37
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":38
+    /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":39
+      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":39
  *     if b > a:
  *         if c > b:
  *             return c             # <<<<<<<<<<<<<<
     }
     __pyx_L4:;
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":40
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":40
  *         if c > b:
  *             return c
  *         return b             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":41
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":42
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":42
  *         return b
  *     if a > c:
  *         return a             # <<<<<<<<<<<<<<
   }
   __pyx_L5:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":43
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":43
  *     if a > c:
  *         return a
  *     return c             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":45
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":45
  *     return c
  * 
  * cdef inline int imin3(int a, int b, int c):             # <<<<<<<<<<<<<<
   int __pyx_t_1;
   __Pyx_SetupRefcountContext("imin3");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":46
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":47
+    /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":48
+      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":48
  *     if b < a:
  *         if c < b:
  *             return c             # <<<<<<<<<<<<<<
     }
     __pyx_L4:;
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":49
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":49
  *         if c < b:
  *             return c
  *         return b             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":50
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":51
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":51
  *         return b
  *     if a < c:
  *         return a             # <<<<<<<<<<<<<<
   }
   __pyx_L5:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":52
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":52
  *     if a < c:
  *         return a
  *     return c             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":54
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":54
  *     return c
  * 
  * cdef inline int imin2(int a, int b):             # <<<<<<<<<<<<<<
   int __pyx_t_1;
   __Pyx_SetupRefcountContext("imin2");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":55
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":55
  * 
  * cdef inline int imin2(int a, int b):
  *     if b < a: return b             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":56
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":56
  * cdef inline int imin2(int a, int b):
  *     if b < a: return b
  *     return a             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":74
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":74
  * 
  *     property left_node:
  *         def __get__(self):             # <<<<<<<<<<<<<<
   int __pyx_t_1;
   __Pyx_SetupRefcountContext("__get__");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":75
+  /* "/Users/kanwei/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             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":77
+/* "/Users/kanwei/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):             # <<<<<<<<<<<<<<
   int __pyx_t_1;
   __Pyx_SetupRefcountContext("__get__");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":78
+  /* "/Users/kanwei/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             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":80
+/* "/Users/kanwei/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):             # <<<<<<<<<<<<<<
   int __pyx_t_1;
   __Pyx_SetupRefcountContext("__get__");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":81
+  /* "/Users/kanwei/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             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":83
+/* "/Users/kanwei/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_3 = NULL;
   __Pyx_SetupRefcountContext("__repr__");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":84
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":84
  * 
  *     def __repr__(self):
  *         return "IntervalNode(%i, %i)" % (self.start, self.end)             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":86
+/* "/Users/kanwei/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):             # <<<<<<<<<<<<<<
   return -1;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":91
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":92
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":93
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":94
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":95
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":96
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":97
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":98
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":99
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":100
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":100
  *         self.cleft    = EmptyNode
  *         self.cright   = EmptyNode
  *         self.croot    = EmptyNode             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":102
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":102
  *         self.croot    = EmptyNode
  * 
  *     cpdef IntervalNode insert(IntervalNode self, int start, int end, object interval):             # <<<<<<<<<<<<<<
     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
   }
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":108
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":111
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":112
+  /* "/Users/kanwei/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:             # <<<<<<<<<<<<<<
   __pyx_t_4 = (__pyx_v_start == __pyx_v_self->start);
   if (__pyx_t_4) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":113
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":113
  *         cdef int decision_endpoint = start
  *         if start == self.start:
  *             decision_endpoint = end             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":115
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":115
  *             decision_endpoint = end
  * 
  *         if decision_endpoint > self.start:             # <<<<<<<<<<<<<<
   __pyx_t_4 = (__pyx_v_decision_endpoint > __pyx_v_self->start);
   if (__pyx_t_4) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":117
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":117
  *         if decision_endpoint > self.start:
  *             # insert to cright tree
  *             if self.cright is not EmptyNode:             # <<<<<<<<<<<<<<
     __pyx_t_4 = (__pyx_v_self->cright != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
     if (__pyx_t_4) {
 
-      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":118
+      /* "/Users/kanwei/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*/ {
 
-      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":120
+      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":120
  *                 self.cright = self.cright.insert( start, end, interval )
  *             else:
  *                 self.cright = IntervalNode( start, end, interval )             # <<<<<<<<<<<<<<
     }
     __pyx_L5:;
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":122
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":122
  *                 self.cright = IntervalNode( start, end, interval )
  *             # rebalance tree
  *             if self.priority < self.cright.priority:             # <<<<<<<<<<<<<<
     __pyx_t_4 = (__pyx_v_self->priority < __pyx_v_self->cright->priority);
     if (__pyx_t_4) {
 
-      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":123
+      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":123
  *             # rebalance tree
  *             if self.priority < self.cright.priority:
  *                 croot = self.rotate_left()             # <<<<<<<<<<<<<<
   }
   /*else*/ {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":126
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":126
  *         else:
  *             # insert to cleft tree
  *             if self.cleft is not EmptyNode:             # <<<<<<<<<<<<<<
     __pyx_t_4 = (__pyx_v_self->cleft != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
     if (__pyx_t_4) {
 
-      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":127
+      /* "/Users/kanwei/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*/ {
 
-      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":129
+      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":129
  *                 self.cleft = self.cleft.insert( start, end, interval)
  *             else:
  *                 self.cleft = IntervalNode( start, end, interval)             # <<<<<<<<<<<<<<
     }
     __pyx_L7:;
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":131
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":131
  *                 self.cleft = IntervalNode( start, end, interval)
  *             # rebalance tree
  *             if self.priority < self.cleft.priority:             # <<<<<<<<<<<<<<
     __pyx_t_4 = (__pyx_v_self->priority < __pyx_v_self->cleft->priority);
     if (__pyx_t_4) {
 
-      /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":132
+      /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":132
  *             # rebalance tree
  *             if self.priority < self.cleft.priority:
  *                 croot = self.rotate_right()             # <<<<<<<<<<<<<<
   }
   __pyx_L4:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":134
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":135
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":136
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":137
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":137
  *         self.cleft.croot  = croot
  *         self.cright.croot = croot
  *         return croot             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":102
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":102
  *         self.croot    = EmptyNode
  * 
  *     cpdef IntervalNode insert(IntervalNode self, int start, int end, object interval):             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":139
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":139
  *         return croot
  * 
  *     cdef IntervalNode rotate_right(IntervalNode self):             # <<<<<<<<<<<<<<
   struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_r = NULL;
   __Pyx_SetupRefcountContext("rotate_right");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":140
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":141
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":142
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":143
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":144
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":144
  *         croot.cright = self
  *         self.set_ends()
  *         return croot             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":146
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":146
  *         return croot
  * 
  *     cdef IntervalNode rotate_left(IntervalNode self):             # <<<<<<<<<<<<<<
   struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *__pyx_r = NULL;
   __Pyx_SetupRefcountContext("rotate_left");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":147
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":148
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":149
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":150
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":151
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":151
  *         croot.cleft  = self
  *         self.set_ends()
  *         return croot             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":153
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":153
  *         return croot
  * 
  *     cdef inline void set_ends(IntervalNode self):             # <<<<<<<<<<<<<<
   int __pyx_t_3;
   __Pyx_SetupRefcountContext("set_ends");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":154
+  /* "/Users/kanwei/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/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":155
+    /* "/Users/kanwei/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)             # <<<<<<<<<<<<<<
  */
     __pyx_v_self->maxend = __pyx_f_2bx_9intervals_12intersection_imax3(__pyx_v_self->end, __pyx_v_self->cright->maxend, __pyx_v_self->cleft->maxend);
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":156
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":156
  *         if self.cright is not EmptyNode and self.cleft is not EmptyNode:
  *             self.maxend = imax3(self.end, self.cright.maxend, self.cleft.maxend)
  *             self.minend = imin3(self.end, self.cright.minend, self.cleft.minend)             # <<<<<<<<<<<<<<
  */
     __pyx_v_self->minend = __pyx_f_2bx_9intervals_12intersection_imin3(__pyx_v_self->end, __pyx_v_self->cright->minend, __pyx_v_self->cleft->minend);
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":157
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":157
  *             self.maxend = imax3(self.end, self.cright.maxend, self.cleft.maxend)
  *             self.minend = imin3(self.end, self.cright.minend, self.cleft.minend)
  *             self.minstart = imin3(self.start, self.cright.minstart, self.cleft.minstart)             # <<<<<<<<<<<<<<
     goto __pyx_L3;
   }
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":158
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":158
  *             self.minend = imin3(self.end, self.cright.minend, self.cleft.minend)
  *             self.minstart = imin3(self.start, self.cright.minstart, self.cleft.minstart)
  *         elif self.cright is not EmptyNode:             # <<<<<<<<<<<<<<
   __pyx_t_3 = (__pyx_v_self->cright != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
   if (__pyx_t_3) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":159
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":159
  *             self.minstart = imin3(self.start, self.cright.minstart, self.cleft.minstart)
  *         elif self.cright is not EmptyNode:
  *             self.maxend = imax2(self.end, self.cright.maxend)             # <<<<<<<<<<<<<<
  */
     __pyx_v_self->maxend = __pyx_f_2bx_9intervals_12intersection_imax2(__pyx_v_self->end, __pyx_v_self->cright->maxend);
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":160
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":160
  *         elif self.cright is not EmptyNode:
  *             self.maxend = imax2(self.end, self.cright.maxend)
  *             self.minend = imin2(self.end, self.cright.minend)             # <<<<<<<<<<<<<<
  */
     __pyx_v_self->minend = __pyx_f_2bx_9intervals_12intersection_imin2(__pyx_v_self->end, __pyx_v_self->cright->minend);
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":161
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":161
  *             self.maxend = imax2(self.end, self.cright.maxend)
  *             self.minend = imin2(self.end, self.cright.minend)
  *             self.minstart = imin2(self.start, self.cright.minstart)             # <<<<<<<<<<<<<<
     goto __pyx_L3;
   }
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":162
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":162
  *             self.minend = imin2(self.end, self.cright.minend)
  *             self.minstart = imin2(self.start, self.cright.minstart)
  *         elif self.cleft is not EmptyNode:             # <<<<<<<<<<<<<<
   __pyx_t_3 = (__pyx_v_self->cleft != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
   if (__pyx_t_3) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":163
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":163
  *             self.minstart = imin2(self.start, self.cright.minstart)
  *         elif self.cleft is not EmptyNode:
  *             self.maxend = imax2(self.end, self.cleft.maxend)             # <<<<<<<<<<<<<<
  */
     __pyx_v_self->maxend = __pyx_f_2bx_9intervals_12intersection_imax2(__pyx_v_self->end, __pyx_v_self->cleft->maxend);
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":164
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":164
  *         elif self.cleft is not EmptyNode:
  *             self.maxend = imax2(self.end, self.cleft.maxend)
  *             self.minend = imin2(self.end, self.cleft.minend)             # <<<<<<<<<<<<<<
  */
     __pyx_v_self->minend = __pyx_f_2bx_9intervals_12intersection_imin2(__pyx_v_self->end, __pyx_v_self->cleft->minend);
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":165
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":165
  *             self.maxend = imax2(self.end, self.cleft.maxend)
  *             self.minend = imin2(self.end, self.cleft.minend)
  *             self.minstart = imin2(self.start, self.cleft.minstart)             # <<<<<<<<<<<<<<
   __Pyx_FinishRefcountContext();
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":168
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":168
  * 
  * 
  *     def intersect( self, int start, int end, sort=True ):             # <<<<<<<<<<<<<<
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":173
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":173
  *         falling within that range
  *         """
  *         cdef list results = []             # <<<<<<<<<<<<<<
   __pyx_v_results = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":174
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":174
  *         """
  *         cdef list results = []
  *         self._intersect( start, end, results )             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self)->__pyx_vtab)->_intersect(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self), __pyx_v_start, __pyx_v_end, __pyx_v_results);
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":175
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":175
  *         cdef list results = []
  *         self._intersect( start, end, results )
  *         return results             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":179
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":179
  *     find = intersect
  * 
  *     cdef void _intersect( IntervalNode self, int start, int end, list results ):             # <<<<<<<<<<<<<<
   int __pyx_t_3;
   __Pyx_SetupRefcountContext("_intersect");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":181
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":181
  *     cdef void _intersect( IntervalNode self, int start, int end, list results ):
  *         # Left subtree
  *         if self.cleft is not EmptyNode and self.cleft.maxend > start:             # <<<<<<<<<<<<<<
   }
   if (__pyx_t_2) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":182
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":182
  *         # Left subtree
  *         if self.cleft is not EmptyNode and self.cleft.maxend > start:
  *             self.cleft._intersect( start, end, results )             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":184
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":184
  *             self.cleft._intersect( start, end, results )
  *         # This interval
  *         if ( self.end > start ) and ( self.start < end ):             # <<<<<<<<<<<<<<
   }
   if (__pyx_t_2) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":185
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":185
  *         # This interval
  *         if ( self.end > start ) and ( self.start < end ):
  *             results.append( self.interval )             # <<<<<<<<<<<<<<
   }
   __pyx_L4:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":187
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":187
  *             results.append( self.interval )
  *         # Right subtree
  *         if self.cright is not EmptyNode and self.start < end:             # <<<<<<<<<<<<<<
   }
   if (__pyx_t_1) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":188
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":188
  *         # Right subtree
  *         if self.cright is not EmptyNode and self.start < end:
  *             self.cright._intersect( start, end, results )             # <<<<<<<<<<<<<<
   __Pyx_FinishRefcountContext();
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":191
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":191
  * 
  * 
  *     cdef void _seek_left(IntervalNode self, int position, list results, int n, int max_dist):             # <<<<<<<<<<<<<<
   int __pyx_t_2;
   __Pyx_SetupRefcountContext("_seek_left");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":193
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":193
  *     cdef void _seek_left(IntervalNode self, int position, list results, int n, int max_dist):
  *         # we know we can bail in these 2 cases.
  *         if self.maxend + max_dist < position:             # <<<<<<<<<<<<<<
   __pyx_t_1 = ((__pyx_v_self->maxend + __pyx_v_max_dist) < __pyx_v_position);
   if (__pyx_t_1) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":194
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":194
  *         # we know we can bail in these 2 cases.
  *         if self.maxend + max_dist < position:
  *             return             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":195
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":195
  *         if self.maxend + max_dist < position:
  *             return
  *         if self.minstart > position:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (__pyx_v_self->minstart > __pyx_v_position);
   if (__pyx_t_1) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":196
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":196
  *             return
  *         if self.minstart > position:
  *             return             # <<<<<<<<<<<<<<
   }
   __pyx_L4:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":200
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":200
  *         # the ordering of these 3 blocks makes it so the results are
  *         # ordered nearest to farest from the query position
  *         if self.cright is not EmptyNode:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (__pyx_v_self->cright != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
   if (__pyx_t_1) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":201
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":201
  *         # ordered nearest to farest from the query position
  *         if self.cright is not EmptyNode:
  *             self.cright._seek_left(position, results, n, max_dist)             # <<<<<<<<<<<<<<
   }
   __pyx_L5:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":203
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":203
  *             self.cright._seek_left(position, results, n, max_dist)
  * 
  *         if -1 < position - self.end < max_dist:             # <<<<<<<<<<<<<<
   }
   if (__pyx_t_1) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":204
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":204
  * 
  *         if -1 < position - self.end < max_dist:
  *             results.append(self.interval)             # <<<<<<<<<<<<<<
   }
   __pyx_L6:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":207
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":207
  * 
  *         # TODO: can these conditionals be more stringent?
  *         if self.cleft is not EmptyNode:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (__pyx_v_self->cleft != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
   if (__pyx_t_1) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":208
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":208
  *         # TODO: can these conditionals be more stringent?
  *         if self.cleft is not EmptyNode:
  *                 self.cleft._seek_left(position, results, n, max_dist)             # <<<<<<<<<<<<<<
   __Pyx_FinishRefcountContext();
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":212
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":212
  * 
  * 
  *     cdef void _seek_right(IntervalNode self, int position, list results, int n, int max_dist):             # <<<<<<<<<<<<<<
   int __pyx_t_2;
   __Pyx_SetupRefcountContext("_seek_right");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":214
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":214
  *     cdef void _seek_right(IntervalNode self, int position, list results, int n, int max_dist):
  *         # we know we can bail in these 2 cases.
  *         if self.maxend < position: return             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":215
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":215
  *         # we know we can bail in these 2 cases.
  *         if self.maxend < position: return
  *         if self.minstart - max_dist > position: return             # <<<<<<<<<<<<<<
   }
   __pyx_L4:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":221
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":221
  *         # the ordering of these 3 blocks makes it so the results are
  *         # ordered nearest to farest from the query position
  *         if self.cleft is not EmptyNode:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (__pyx_v_self->cleft != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
   if (__pyx_t_1) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":222
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":222
  *         # ordered nearest to farest from the query position
  *         if self.cleft is not EmptyNode:
  *                 self.cleft._seek_right(position, results, n, max_dist)             # <<<<<<<<<<<<<<
   }
   __pyx_L5:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":224
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":224
  *                 self.cleft._seek_right(position, results, n, max_dist)
  * 
  *         if -1 < self.start - position < max_dist:             # <<<<<<<<<<<<<<
   }
   if (__pyx_t_1) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":225
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":225
  * 
  *         if -1 < self.start - position < max_dist:
  *             results.append(self.interval)             # <<<<<<<<<<<<<<
   }
   __pyx_L6:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":227
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":227
  *             results.append(self.interval)
  * 
  *         if self.cright is not EmptyNode:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (__pyx_v_self->cright != __pyx_v_2bx_9intervals_12intersection_EmptyNode);
   if (__pyx_t_1) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":228
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":228
  * 
  *         if self.cright is not EmptyNode:
  *                 self.cright._seek_right(position, results, n, max_dist)             # <<<<<<<<<<<<<<
   __Pyx_FinishRefcountContext();
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":231
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":231
  * 
  * 
  *     cpdef left(self, position, int n=1, int max_dist=2500):             # <<<<<<<<<<<<<<
     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
   }
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":238
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":238
  *         max_dist: the maximum distance to look before giving up.
  *         """
  *         cdef list results = []             # <<<<<<<<<<<<<<
   __pyx_v_results = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":240
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":240
  *         cdef list results = []
  *         # use start - 1 becuase .left() assumes strictly left-of
  *         self._seek_left( position - 1, results, n, max_dist )             # <<<<<<<<<<<<<<
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->__pyx_vtab)->_seek_left(__pyx_v_self, __pyx_t_4, __pyx_v_results, __pyx_v_n, __pyx_v_max_dist);
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":241
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":241
  *         # use start - 1 becuase .left() assumes strictly left-of
  *         self._seek_left( position - 1, results, n, max_dist )
  *         if len(results) == n: return results             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":242
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":242
  *         self._seek_left( position - 1, results, n, max_dist )
  *         if len(results) == n: return results
  *         r = results             # <<<<<<<<<<<<<<
   __Pyx_DECREF(__pyx_v_r);
   __pyx_v_r = ((PyObject *)__pyx_v_results);
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":243
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":243
  *         if len(results) == n: return results
  *         r = results
  *         r.sort(key=operator.attrgetter('end'), reverse=True)             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":244
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":244
  *         r = results
  *         r.sort(key=operator.attrgetter('end'), reverse=True)
  *         return r[:n]             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":231
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":231
  * 
  * 
  *     cpdef left(self, position, int n=1, int max_dist=2500):             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":246
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":246
  *         return r[:n]
  * 
  *     cpdef right(self, position, int n=1, int max_dist=2500):             # <<<<<<<<<<<<<<
     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
   }
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":253
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":253
  *         max_dist: the maximum distance to look before giving up.
  *         """
  *         cdef list results = []             # <<<<<<<<<<<<<<
   __pyx_v_results = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":255
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":255
  *         cdef list results = []
  *         # use end + 1 becuase .right() assumes strictly right-of
  *         self._seek_right(position + 1, results, n, max_dist)             # <<<<<<<<<<<<<<
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)__pyx_v_self->__pyx_vtab)->_seek_right(__pyx_v_self, __pyx_t_4, __pyx_v_results, __pyx_v_n, __pyx_v_max_dist);
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":256
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":256
  *         # use end + 1 becuase .right() assumes strictly right-of
  *         self._seek_right(position + 1, results, n, max_dist)
  *         if len(results) == n: return results             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":257
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":257
  *         self._seek_right(position + 1, results, n, max_dist)
  *         if len(results) == n: return results
  *         r = results             # <<<<<<<<<<<<<<
   __Pyx_DECREF(__pyx_v_r);
   __pyx_v_r = ((PyObject *)__pyx_v_results);
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":258
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":258
  *         if len(results) == n: return results
  *         r = results
  *         r.sort(key=operator.attrgetter('start'))             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":259
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":259
  *         r = results
  *         r.sort(key=operator.attrgetter('start'))
  *         return r[:n]             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":246
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":246
  *         return r[:n]
  * 
  *     cpdef right(self, position, int n=1, int max_dist=2500):             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":261
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":261
  *         return r[:n]
  * 
  *     def traverse(self, func):             # <<<<<<<<<<<<<<
   PyObject *__pyx_r = NULL;
   __Pyx_SetupRefcountContext("traverse");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":262
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":262
  * 
  *     def traverse(self, func):
  *         self._traverse(func)             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":264
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":264
  *         self._traverse(func)
  * 
  *     cdef void _traverse(IntervalNode self, object func):             # <<<<<<<<<<<<<<
   PyObject *__pyx_t_3 = NULL;
   __Pyx_SetupRefcountContext("_traverse");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":265
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":265
  * 
  *     cdef void _traverse(IntervalNode self, object func):
  *         if self.cleft is not EmptyNode: self.cleft._traverse(func)             # <<<<<<<<<<<<<<
   }
   __pyx_L3:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":266
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":266
  *     cdef void _traverse(IntervalNode self, object func):
  *         if self.cleft is not EmptyNode: self.cleft._traverse(func)
  *         func(self)             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":267
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":267
  *         if self.cleft is not EmptyNode: self.cleft._traverse(func)
  *         func(self)
  *         if self.cright is not EmptyNode: self.cright._traverse(func)             # <<<<<<<<<<<<<<
   __Pyx_FinishRefcountContext();
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":290
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":290
  *     cdef public object value, chrom, strand
  * 
  *     def __init__(self, int start, int end, object value=None, object chrom=None, object strand=None ):             # <<<<<<<<<<<<<<
   return -1;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":291
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":291
  * 
  *     def __init__(self, int start, int end, object value=None, object chrom=None, object strand=None ):
  *         assert start <= end, "start must be less than end"             # <<<<<<<<<<<<<<
   }
   #endif
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":292
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":292
  *     def __init__(self, int start, int end, object value=None, object chrom=None, object strand=None ):
  *         assert start <= end, "start must be less than end"
  *         self.start  = start             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->start = __pyx_v_start;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":293
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":293
  *         assert start <= end, "start must be less than end"
  *         self.start  = start
  *         self.end   = end             # <<<<<<<<<<<<<<
  */
   ((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->end = __pyx_v_end;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":294
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":294
  *         self.start  = start
  *         self.end   = end
  *         self.value = value             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->value);
   ((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->value = __pyx_v_value;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":295
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":295
  *         self.end   = end
  *         self.value = value
  *         self.chrom = chrom             # <<<<<<<<<<<<<<
   __Pyx_DECREF(((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->chrom);
   ((struct __pyx_obj_2bx_9intervals_12intersection_Interval *)__pyx_v_self)->chrom = __pyx_v_chrom;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":296
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":296
  *         self.value = value
  *         self.chrom = chrom
  *         self.strand = strand             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":298
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":298
  *         self.strand = strand
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
   __Pyx_SetupRefcountContext("__repr__");
   __pyx_v_fstr = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":299
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":299
  * 
  *     def __repr__(self):
  *         fstr = "Interval(%d, %d" % (self.start, self.end)             # <<<<<<<<<<<<<<
   __pyx_v_fstr = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":300
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":300
  *     def __repr__(self):
  *         fstr = "Interval(%d, %d" % (self.start, self.end)
  *         if not self.value is None:             # <<<<<<<<<<<<<<
   __pyx_t_5 = (!__pyx_t_4);
   if (__pyx_t_5) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":301
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":301
  *         fstr = "Interval(%d, %d" % (self.start, self.end)
  *         if not self.value is None:
  *             fstr += ", value=" + str(self.value)             # <<<<<<<<<<<<<<
   }
   __pyx_L5:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":302
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":302
  *         if not self.value is None:
  *             fstr += ", value=" + str(self.value)
  *         fstr += ")"             # <<<<<<<<<<<<<<
   __pyx_v_fstr = __pyx_1;
   __pyx_1 = 0;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":303
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":303
  *             fstr += ", value=" + str(self.value)
  *         fstr += ")"
  *         return fstr             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":305
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":305
  *         return fstr
  * 
  *     def __cmp__(self, other):             # <<<<<<<<<<<<<<
   int __pyx_t_6;
   __Pyx_SetupRefcountContext("__cmp__");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":306
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":306
  * 
  *     def __cmp__(self, other):
  *         return cmp( self.start, other.start ) or cmp( self.end, other.end )             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":366
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":366
  *     cdef IntervalNode root
  * 
  *     def __cinit__( self ):             # <<<<<<<<<<<<<<
   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":367
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":367
  * 
  *     def __cinit__( self ):
  *         root = None             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":371
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":371
  *     # ---- Position based interfaces -----------------------------------------
  * 
  *     def insert( self, int start, int end, object value=None ):             # <<<<<<<<<<<<<<
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":375
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":375
  *         Insert the interval [start,end) associated with value `value`.
  *         """
  *         if self.root is None:             # <<<<<<<<<<<<<<
   __pyx_t_1 = (((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root) == Py_None);
   if (__pyx_t_1) {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":376
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":376
  *         """
  *         if self.root is None:
  *             self.root = IntervalNode( start, end, value )             # <<<<<<<<<<<<<<
   }
   /*else*/ {
 
-    /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":378
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":378
  *             self.root = IntervalNode( start, end, value )
  *         else:
  *             self.root = self.root.insert( start, end, value )             # <<<<<<<<<<<<<<
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":383
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":383
  * 
  * 
  *     def find( self, start, end ):             # <<<<<<<<<<<<<<
   PyObject *__pyx_v_start = 0;
   PyObject *__pyx_v_end = 0;
   PyObject *__pyx_r = NULL;
-  PyObject *__pyx_t_1 = NULL;
+  int __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_start,&__pyx_kp_end,0};
   __Pyx_SetupRefcountContext("find");
   if (unlikely(__pyx_kwds)) {
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":387
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":387
  *         Return a sorted list of all intervals overlapping [start,end).
  *         """
+ *         if self.root is None:             # <<<<<<<<<<<<<<
+ *             return []
+ *         return self.root.find( start, end )
+ */
+  __pyx_t_1 = (((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root) == Py_None);
+  if (__pyx_t_1) {
+
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":388
+ *         """
+ *         if self.root is None:
+ *             return []             # <<<<<<<<<<<<<<
+ *         return self.root.find( start, end )
+ * 
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    __pyx_r = ((PyObject *)__pyx_t_2);
+    __pyx_t_2 = 0;
+    goto __pyx_L0;
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":389
+ *         if self.root is None:
+ *             return []
  *         return self.root.find( start, end )             # <<<<<<<<<<<<<<
  * 
  *     def before( self, position, num_intervals=1, max_dist=2500 ):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root), __pyx_kp_find); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root), __pyx_kp_find); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __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 = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
   __Pyx_INCREF(__pyx_v_start);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_start);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_start);
   __Pyx_GIVEREF(__pyx_v_start);
   __Pyx_INCREF(__pyx_v_end);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_end);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_end);
   __Pyx_GIVEREF(__pyx_v_end);
-  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __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.IntervalTree.find");
   __pyx_r = NULL;
   __pyx_L0:;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":389
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":391
  *         return self.root.find( start, end )
  * 
  *     def before( self, position, num_intervals=1, max_dist=2500 ):             # <<<<<<<<<<<<<<
  */
 
 static PyObject *__pyx_pf_2bx_9intervals_12intersection_12IntervalTree_before(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_2bx_9intervals_12intersection_12IntervalTree_before[] = "\n        Find `num_intervals` intervals that lie before `position` and are no\n        further than `max_dist` positions aways\n        ";
+static char __pyx_doc_2bx_9intervals_12intersection_12IntervalTree_before[] = "\n        Find `num_intervals` intervals that lie before `position` and are no\n        further than `max_dist` positions away\n        ";
 static PyObject *__pyx_pf_2bx_9intervals_12intersection_12IntervalTree_before(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_position = 0;
   PyObject *__pyx_v_num_intervals = 0;
   PyObject *__pyx_r = NULL;
   struct __pyx_opt_args_2bx_9intervals_12intersection_12IntervalNode_left __pyx_1;
   int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_2 = NULL;
+  int __pyx_t_3;
+  int __pyx_t_4;
   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_position,&__pyx_kp_num_intervals,&__pyx_kp_max_dist,0};
   __Pyx_SetupRefcountContext("before");
   if (unlikely(__pyx_kwds)) {
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "before") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "before") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_position = values[0];
     __pyx_v_num_intervals = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("before", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("before", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.before");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":394
- *         further than `max_dist` positions aways
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":396
+ *         further than `max_dist` positions away
  *         """
+ *         if self.root is None:             # <<<<<<<<<<<<<<
+ *             return []
+ *         return self.root.left( position, num_intervals, max_dist )
+ */
+  __pyx_t_1 = (((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root) == Py_None);
+  if (__pyx_t_1) {
+
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":397
+ *         """
+ *         if self.root is None:
+ *             return []             # <<<<<<<<<<<<<<
+ *         return self.root.left( position, num_intervals, max_dist )
+ * 
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    __pyx_r = ((PyObject *)__pyx_t_2);
+    __pyx_t_2 = 0;
+    goto __pyx_L0;
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":398
+ *         if self.root is None:
+ *             return []
  *         return self.root.left( position, num_intervals, max_dist )             # <<<<<<<<<<<<<<
  * 
  *     def after( self, position, num_intervals=1, max_dist=2500 ):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_1.__pyx_n = 2;
-  __pyx_1.n = __pyx_t_1;
-  __pyx_1.max_dist = __pyx_t_2;
-  __pyx_t_3 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->left(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_v_position, 0, &__pyx_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_1.n = __pyx_t_3;
+  __pyx_1.max_dist = __pyx_t_4;
+  __pyx_t_2 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->left(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_v_position, 0, &__pyx_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_2);
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.before");
   __pyx_r = NULL;
   __pyx_L0:;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":396
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":400
  *         return self.root.left( position, num_intervals, max_dist )
  * 
  *     def after( self, position, num_intervals=1, max_dist=2500 ):             # <<<<<<<<<<<<<<
  */
 
 static PyObject *__pyx_pf_2bx_9intervals_12intersection_12IntervalTree_after(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_2bx_9intervals_12intersection_12IntervalTree_after[] = "\n        Find `num_intervals` intervals that lie after `position` and are no\n        further than `max_dist` positions aways\n        ";
+static char __pyx_doc_2bx_9intervals_12intersection_12IntervalTree_after[] = "\n        Find `num_intervals` intervals that lie after `position` and are no\n        further than `max_dist` positions away\n        ";
 static PyObject *__pyx_pf_2bx_9intervals_12intersection_12IntervalTree_after(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_position = 0;
   PyObject *__pyx_v_num_intervals = 0;
   PyObject *__pyx_r = NULL;
   struct __pyx_opt_args_2bx_9intervals_12intersection_12IntervalNode_right __pyx_1;
   int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_2 = NULL;
+  int __pyx_t_3;
+  int __pyx_t_4;
   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_position,&__pyx_kp_num_intervals,&__pyx_kp_max_dist,0};
   __Pyx_SetupRefcountContext("after");
   if (unlikely(__pyx_kwds)) {
       }
     }
     if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "after") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "after") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     }
     __pyx_v_position = values[0];
     __pyx_v_num_intervals = values[1];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("after", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("after", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.after");
   return NULL;
   __pyx_L4_argument_unpacking_done:;
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":401
- *         further than `max_dist` positions aways
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":405
+ *         further than `max_dist` positions away
  *         """
+ *         if self.root is None:             # <<<<<<<<<<<<<<
+ *             return []
+ *         return self.root.right( position, num_intervals, max_dist )
+ */
+  __pyx_t_1 = (((PyObject *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root) == Py_None);
+  if (__pyx_t_1) {
+
+    /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":406
+ *         """
+ *         if self.root is None:
+ *             return []             # <<<<<<<<<<<<<<
+ *         return self.root.right( position, num_intervals, max_dist )
+ * 
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    __pyx_r = ((PyObject *)__pyx_t_2);
+    __pyx_t_2 = 0;
+    goto __pyx_L0;
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":407
+ *         if self.root is None:
+ *             return []
  *         return self.root.right( position, num_intervals, max_dist )             # <<<<<<<<<<<<<<
  * 
  *     # ---- Interval-like object based interfaces -----------------------------
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_num_intervals); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_dist); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_1.__pyx_n = 2;
-  __pyx_1.n = __pyx_t_1;
-  __pyx_1.max_dist = __pyx_t_2;
-  __pyx_t_3 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->right(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_v_position, 0, &__pyx_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
+  __pyx_1.n = __pyx_t_3;
+  __pyx_1.max_dist = __pyx_t_4;
+  __pyx_t_2 = ((struct __pyx_vtabstruct_2bx_9intervals_12intersection_IntervalNode *)((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root->__pyx_vtab)->right(((struct __pyx_obj_2bx_9intervals_12intersection_IntervalTree *)__pyx_v_self)->root, __pyx_v_position, 0, &__pyx_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
   __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_2);
   __Pyx_AddTraceback("bx.intervals.intersection.IntervalTree.after");
   __pyx_r = NULL;
   __pyx_L0:;
   return __pyx_r;
 }
 
-/* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":405
+/* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":411
  *     # ---- Interval-like object based interfaces -----------------------------
  * 
  *     def insert_interval( self, interval ):             # <<<<<<<<<<<<<<
   PyObject *__pyx_t_4 = NULL;
   __Pyx_SetupRefcountContext("insert_interval");
 
-  /* "/Users/james/projects/bx-python/code/bx-python-central/lib/bx/intervals/intersection.pyx":410
+  /* "/Users/kanwei/bx-python/lib/bx/intervals/intersection.pyx":416
  *         attributes)
  *         """
  *         self.insert( interval.start, interval.end, interval )             # <<<<<<<<<<<<<<
  * 
  *     add_interval = insert_interval
  */
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_insert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_insert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_GetAttr(__pyx_v_interval, __pyx_kp_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}