for(int i = 0; i < surfingsessions.length; i++) { var session = surfingsessions[i]; if(!checklicense(session.user) && session.state == "unlicensed") { notifyuser("please renew your surfing license to continue enjoying the waves."); } else if(session.state == "pre-introductory") { studywavepatterns(session); } else { passbyrestrictions(session); } }