distance sorting seems doesn't work