Proper order for distance based filter