Updated gatherstats shellscript