updated Set_to_diagonal