modified max-distance filter to count only alive objects
removed unnecessary return type