efficient approximation of kd tree