Creating a state object