set diagonals back to one in the node_index function