spot_cred = 'P'; tag_cred = 'R'; new_A=array(D) new_D=array(P,R) new_P=array(A,D,R,G) is_valid=0 index = 0 if time > 5:00: for item in new_ + spot_cred if tag_cred == new_ + spot_cred[index]: $is_valid = 1; index = index + 1 else if tag_cred == spot_cred: is valid =1;