Started working on state logic