kdTree: insert and draw API implementation