update the format of output, and the template arguments of input