non si riesce a sistemare questo codice ?

non vorrei stravolgere la struttura del software