Copied tokenify function from lab 2 to aid in numeric parsing.