Revert "Revert "correzione errore in funzioni""

This reverts commit 4de19601c4481f16225a2f6ddb7a96db3ff2fe12.