Change switch statements to if/elsif/else