switch example code order slightly