replaced sscanf by strtol
introduces strtok to parse string
coding conventions