added scale
fixed bug in numberWithCommas
added stats output