removed use of strcat, replaced with snprintf