dovresti inserire una funzione che in base al brw switch sulla funzione corretta