updated to construct names on the fly