Change to loop the other way through array in isUpperTriangular