resolved security issues with sprintf, strcat, and strcpy. converted to snprintf, strlcat, and strlcpy. now need to recheck everything with valgrind