come usare la funzione switch