replaced all calls to snprintf with sprintf