First working version of the simple switch statemachine template