apply distance