a tutorial of kd tree