Working kd tree implementation for small bunny