implement upperTriangular