Added top level state machine with messages