changed itoa to snprintf