Add streamStat, modify main to use it