Function reworked. strtok() call removed as well as include string.h.