added top-level groups to format and output