Currently this function does not take into account the z values. I will create an issue for propose this improve.