2nd version: added strtok and Makefile