add flatten_scatt & format_scatt