add avg_format tool