bug fix on diagonals addition