Completed input routine and tokenizer