Working switch example