write rfind in terms of npos as daniel requested