Updated referral count calculation