Implementation of BSP Tree