triangular solution made clearer