State Machine Addition

Adding utility script and state machine