Changed isMember function to indexOf