* replaced strtok with strtok_r for thread safety