Fourth tutorial use switch

Use switch for simplify