added states, cleaned up