needs a state object