change to use namedtuples