Add state concept
Working on state machine