change return type of canonicalNumbering from matrix to list