New get_state function

This function allows getting the items in any possible state.