generalizing the two state approach