added smach state machine and isaac's code