Preparing for distance filter