correct jarpat distance sorting