Replaced strsplit with strtok