yet another bug in the diagnol calculation!