added splitthousands function