add a simple version of kd-tree