Adding distance filter and initialize method.