fixed bug, added addCommas() function