adding state implementation