resolvendo o bug do set_diagonal