Better implementation for RejectDistance